From 8cad97a214f23311a24143b9e18ce3b9a5d6c0a2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Jul 2024 11:22:07 +0100 Subject: [PATCH 01/90] chore(deps): bump @hyperjump/json-schema from 1.6.7 to 1.9.3 (#8363) * chore(deps): bump @hyperjump/json-schema from 1.6.7 to 1.9.3 Bumps [@hyperjump/json-schema](https://github.com/hyperjump-io/json-schema) from 1.6.7 to 1.9.3. - [Commits](https://github.com/hyperjump-io/json-schema/compare/v1.6.7...v1.9.3) --- updated-dependencies: - dependency-name: "@hyperjump/json-schema" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * chore(deps): Add dev dependency on @hyperjump/browser @hyperjump/json-schema (v1.7.0 and later) depends upon @hyperjump/browser, but fails to declare it as a dependency, only listing it as a peer dependency, so said package must be installed separately. * fix(tests): Use BASIC output as DETAILED is no longer supported See issue hyperjump-io/json-chema#68 for additional info. * feat(tests): Add more informational output in case of test failure Since the BASIC output of the schema verifier is (slightly) less helpful than the old DETAILED output, add an additional output containing the first invalid path, e.g.: #/9.3.0/0/exports/textToDom/newModule in the results object returned by validate, since this is the most useful part of that info. Also use console.error and console.info instead of console.log where appropriate. * chore(tests): Format --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Christopher Allen --- package-lock.json | 101 ++++++++++++------------- package.json | 1 + tests/migration/validate-renamings.mjs | 17 +++-- 3 files changed, 61 insertions(+), 58 deletions(-) diff --git a/package-lock.json b/package-lock.json index 870d5a013..df47a0301 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "@blockly/block-test": "^6.0.4", "@blockly/dev-tools": "^8.0.4", "@blockly/theme-modern": "^6.0.3", + "@hyperjump/browser": "^1.1.4", "@hyperjump/json-schema": "^1.5.0", "@microsoft/api-documenter": "^7.22.4", "@microsoft/api-extractor": "^7.29.5", @@ -324,15 +325,6 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/@fastify/busboy": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.0.0.tgz", - "integrity": "sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ==", - "dev": true, - "engines": { - "node": ">=14" - } - }, "node_modules/@gulp-sourcemaps/identity-map": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@gulp-sourcemaps/identity-map/-/identity-map-2.0.1.tgz", @@ -463,33 +455,17 @@ "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", "dev": true }, - "node_modules/@hyperjump/json-pointer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@hyperjump/json-pointer/-/json-pointer-1.0.1.tgz", - "integrity": "sha512-vV2pSc7JCwbKEMzh8kr/ICZdO+UZbA3aZ7N8t7leDi9cduWKa9yoP5LS04LnsbErlPbUNHvWBFlbTaR/o/uf7A==", + "node_modules/@hyperjump/browser": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@hyperjump/browser/-/browser-1.1.4.tgz", + "integrity": "sha512-85rfa3B79MssMOxNChvXJhfgvIXqA2FEzwrxKe9iMpCKZVQIxQe54w210VeFM0D33pVOeNskg7TyptSjenY2+w==", "dev": true, + "license": "MIT", "dependencies": { - "just-curry-it": "^5.3.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/jdesrosiers" - } - }, - "node_modules/@hyperjump/json-schema": { - "version": "1.6.7", - "resolved": "https://registry.npmjs.org/@hyperjump/json-schema/-/json-schema-1.6.7.tgz", - "integrity": "sha512-6ufO5Iov85FBXQ1a//7sQDwzZRoyEMR1MD7Te6k00DvApvj1/x3k/S1RcPmmPCCuj7BDxHVixu4qBTM6sBsmBA==", - "dev": true, - "dependencies": { - "@hyperjump/json-pointer": "^1.0.0", - "@hyperjump/pact": "^1.2.0", + "@hyperjump/json-pointer": "^1.1.0", "@hyperjump/uri": "^1.2.0", - "content-type": "^1.0.4", - "fastest-stable-stringify": "^2.0.2", - "just-curry-it": "^5.3.0", - "undici": "^5.19.1", - "uuid": "^9.0.0" + "content-type": "^1.0.5", + "just-curry-it": "^5.3.0" }, "engines": { "node": ">=18.0.0" @@ -499,6 +475,38 @@ "url": "https://github.com/sponsors/jdesrosiers" } }, + "node_modules/@hyperjump/json-pointer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@hyperjump/json-pointer/-/json-pointer-1.1.0.tgz", + "integrity": "sha512-tFCKxMKDKK3VEdtUA3EBOS9GmSOS4mbrTjh9v3RnK10BphDMOb6+bxTh++/ae1AyfHyWb6R54O/iaoAtPMZPCg==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/jdesrosiers" + } + }, + "node_modules/@hyperjump/json-schema": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/@hyperjump/json-schema/-/json-schema-1.9.3.tgz", + "integrity": "sha512-NZyQ+PSQKUVIO0PInwqk2EOOObJD/ZqR9awzZeOddwtJyLZaxim9/xizZ6gGxGZi5ZGIdIB1mkBTM9fBu85E4A==", + "dev": true, + "dependencies": { + "@hyperjump/json-pointer": "^1.1.0", + "@hyperjump/pact": "^1.2.0", + "@hyperjump/uri": "^1.2.0", + "content-type": "^1.0.4", + "json-stringify-deterministic": "^1.0.12", + "just-curry-it": "^5.3.0", + "uuid": "^9.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/jdesrosiers" + }, + "peerDependencies": { + "@hyperjump/browser": "^1.1.0" + } + }, "node_modules/@hyperjump/pact": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@hyperjump/pact/-/pact-1.2.0.tgz", @@ -4827,12 +4835,6 @@ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, - "node_modules/fastest-stable-stringify": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/fastest-stable-stringify/-/fastest-stable-stringify-2.0.2.tgz", - "integrity": "sha512-bijHueCGd0LqqNK9b5oCMHc0MluJAx0cwqASgbWMvkO01lCYgIhacVRLcaDz3QnyYIRNJRDwMb41VuT6pHJ91Q==", - "dev": true - }, "node_modules/fastq": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", @@ -7573,6 +7575,15 @@ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, + "node_modules/json-stringify-deterministic": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/json-stringify-deterministic/-/json-stringify-deterministic-1.0.12.tgz", + "integrity": "sha512-q3PN0lbUdv0pmurkBNdJH3pfFvOTL/Zp0lquqpvcjfKzt6Y0j49EPHAmVHCAS4Ceq/Y+PejWTzyiVpoY71+D6g==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", @@ -11470,18 +11481,6 @@ "integrity": "sha1-5qdUzI8V5YmHqpy9J69m/W9OWvk=", "dev": true }, - "node_modules/undici": { - "version": "5.28.3", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.3.tgz", - "integrity": "sha512-3ItfzbrhDlINjaP0duwnNsKpDQk3acHI3gVJ1z4fmwMK31k5G9OVIAMLSIaP6w4FaGkaAkN6zaQO9LUvZ1t7VA==", - "dev": true, - "dependencies": { - "@fastify/busboy": "^2.0.0" - }, - "engines": { - "node": ">=14.0" - } - }, "node_modules/union": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz", diff --git a/package.json b/package.json index 42ceea979..c0a55f201 100644 --- a/package.json +++ b/package.json @@ -103,6 +103,7 @@ "@blockly/block-test": "^6.0.4", "@blockly/dev-tools": "^8.0.4", "@blockly/theme-modern": "^6.0.3", + "@hyperjump/browser": "^1.1.4", "@hyperjump/json-schema": "^1.5.0", "@microsoft/api-documenter": "^7.22.4", "@microsoft/api-extractor": "^7.29.5", diff --git a/tests/migration/validate-renamings.mjs b/tests/migration/validate-renamings.mjs index b0f0e6f7f..439e216c8 100755 --- a/tests/migration/validate-renamings.mjs +++ b/tests/migration/validate-renamings.mjs @@ -15,7 +15,7 @@ import JSON5 from 'json5'; import {readFile} from 'fs/promises'; import {posixPath} from '../../scripts/helpers.js'; import {validate} from '@hyperjump/json-schema/draft-2020-12'; -import {DETAILED} from '@hyperjump/json-schema/experimental'; +import {BASIC} from '@hyperjump/json-schema/experimental'; /** @type {URL} Renaming schema filename. */ const SCHEMA_URL = new URL('renamings.schema.json', import.meta.url); @@ -29,12 +29,15 @@ const RENAMINGS_URL = new URL( const renamingsJson5 = await readFile(RENAMINGS_URL); const renamings = JSON5.parse(renamingsJson5); -const output = await validate(SCHEMA_URL, renamings, DETAILED); +const output = await validate(SCHEMA_URL, renamings, BASIC); if (!output.valid) { - console.log('Renamings file is invalid.'); - console.log('Maybe this validator output will help you find the problem:'); - console.log(JSON5.stringify(output, undefined, ' ')); + console.error(`Renamings file is invalid. First error occurs at: + ${output.errors[0].instanceLocation}`); + console.info( + `Here is the full validator output, in case that helps:\n`, + output, + ); process.exit(1); } @@ -45,7 +48,7 @@ Object.entries(renamings).forEach(([version, modules]) => { const seen = new Set(); for (const {oldName} of modules) { if (seen.has(oldName)) { - console.log( + console.error( `Duplicate entry for module ${oldName} ` + `in version ${version}.`, ); ok = false; @@ -54,7 +57,7 @@ Object.entries(renamings).forEach(([version, modules]) => { } }); if (!ok) { - console.log('Renamings file is invalid.'); + console.error('Renamings file is invalid.'); process.exit(1); } // Default is a successful exit 0. From 1276c839f131a15044ff9605342ff19517726392 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 09:21:57 +0000 Subject: [PATCH 02/90] chore(deps): bump @microsoft/api-documenter from 7.25.4 to 7.25.7 Bumps [@microsoft/api-documenter](https://github.com/microsoft/rushstack/tree/HEAD/apps/api-documenter) from 7.25.4 to 7.25.7. - [Changelog](https://github.com/microsoft/rushstack/blob/main/apps/api-documenter/CHANGELOG.md) - [Commits](https://github.com/microsoft/rushstack/commits/@microsoft/api-documenter_v7.25.7/apps/api-documenter) --- updated-dependencies: - dependency-name: "@microsoft/api-documenter" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 144 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 123 insertions(+), 21 deletions(-) diff --git a/package-lock.json b/package-lock.json index df47a0301..9345aef02 100644 --- a/package-lock.json +++ b/package-lock.json @@ -627,16 +627,16 @@ } }, "node_modules/@microsoft/api-documenter": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@microsoft/api-documenter/-/api-documenter-7.25.4.tgz", - "integrity": "sha512-hGERhz4L11zni1ifapBK3zhHFcX1QIGoTf0WzoCC0mI2IXfWDJ5ToYMZTPO6qPmn3ElrZtSWcoaHVkaRz16Q/Q==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@microsoft/api-documenter/-/api-documenter-7.25.7.tgz", + "integrity": "sha512-jxGFnZ8olak7q/DVPpMYKb8xvMu9ySmvdx0ltLhkaXXCfD/md5ZlJjEOMNHTnP5I1HclJ1Z8WyRilL+GmycKmw==", "dev": true, "dependencies": { - "@microsoft/api-extractor-model": "7.29.2", + "@microsoft/api-extractor-model": "7.29.3", "@microsoft/tsdoc": "~0.15.0", - "@rushstack/node-core-library": "5.4.1", - "@rushstack/terminal": "0.13.0", - "@rushstack/ts-command-line": "4.22.0", + "@rushstack/node-core-library": "5.5.0", + "@rushstack/terminal": "0.13.2", + "@rushstack/ts-command-line": "4.22.2", "js-yaml": "~3.13.1", "resolve": "~1.22.1" }, @@ -644,6 +644,87 @@ "api-documenter": "bin/api-documenter" } }, + "node_modules/@microsoft/api-documenter/node_modules/@microsoft/api-extractor-model": { + "version": "7.29.3", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.29.3.tgz", + "integrity": "sha512-kEWjLr2ygL3ku9EGyjeTnL2S5IxyH9NaF1k1UoI0Nzwr4xEJBSWCVsWuF2+0lPUrRPA6mTY95fR264SJ5ETKQA==", + "dev": true, + "dependencies": { + "@microsoft/tsdoc": "~0.15.0", + "@microsoft/tsdoc-config": "~0.17.0", + "@rushstack/node-core-library": "5.5.0" + } + }, + "node_modules/@microsoft/api-documenter/node_modules/@rushstack/node-core-library": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-5.5.0.tgz", + "integrity": "sha512-Cl3MYQ74Je5Y/EngMxcA3SpHjGZ/022nKbAO1aycGfQ+7eKyNCBu0oywj5B1f367GCzuHBgy+3BlVLKysHkXZw==", + "dev": true, + "dependencies": { + "ajv": "~8.13.0", + "ajv-draft-04": "~1.0.0", + "ajv-formats": "~3.0.1", + "fs-extra": "~7.0.1", + "import-lazy": "~4.0.0", + "jju": "~1.4.0", + "resolve": "~1.22.1", + "semver": "~7.5.4" + }, + "peerDependencies": { + "@types/node": "*" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@microsoft/api-documenter/node_modules/@rushstack/terminal": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/@rushstack/terminal/-/terminal-0.13.2.tgz", + "integrity": "sha512-t8i0PsGvBHmFBY8pryO3badqFlxQsm2rw3KYrzjcmVkG/WGklKg1qVkr9beAS1Oe8XWDRgj6SkoHkpNjs7aaNw==", + "dev": true, + "dependencies": { + "@rushstack/node-core-library": "5.5.0", + "supports-color": "~8.1.1" + }, + "peerDependencies": { + "@types/node": "*" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@microsoft/api-documenter/node_modules/@rushstack/ts-command-line": { + "version": "4.22.2", + "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.22.2.tgz", + "integrity": "sha512-xkvrGd6D9dPlI3I401Thc640WNsEPB1sGEmy12a2VJaPQPwhE6Ik0gEVPZJ/2G1w213eaCAdxUY1xpiTulsmpA==", + "dev": true, + "dependencies": { + "@rushstack/terminal": "0.13.2", + "@types/argparse": "1.0.38", + "argparse": "~1.0.9", + "string-argv": "~0.3.1" + } + }, + "node_modules/@microsoft/api-documenter/node_modules/ajv": { + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.13.0.tgz", + "integrity": "sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.3", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.4.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/@microsoft/api-documenter/node_modules/argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -666,6 +747,27 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/@microsoft/api-documenter/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "node_modules/@microsoft/api-documenter/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, "node_modules/@microsoft/api-extractor": { "version": "7.47.0", "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.47.0.tgz", @@ -952,20 +1054,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/@rushstack/node-core-library/node_modules/ajv-draft-04": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/ajv-draft-04/-/ajv-draft-04-1.0.0.tgz", - "integrity": "sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw==", - "dev": true, - "peerDependencies": { - "ajv": "^8.5.0" - }, - "peerDependenciesMeta": { - "ajv": { - "optional": true - } - } - }, "node_modules/@rushstack/node-core-library/node_modules/json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", @@ -1960,6 +2048,20 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ajv-draft-04": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ajv-draft-04/-/ajv-draft-04-1.0.0.tgz", + "integrity": "sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw==", + "dev": true, + "peerDependencies": { + "ajv": "^8.5.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, "node_modules/ajv-formats": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", From 5cd3188b58cc99c6bf65785cc1ded91f9aed6c69 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 08:12:01 -0700 Subject: [PATCH 03/90] chore(deps): bump @typescript-eslint/eslint-plugin from 7.16.0 to 7.16.1 (#8411) Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 7.16.0 to 7.16.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.16.1/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 288 +++------------------------------------------- 1 file changed, 18 insertions(+), 270 deletions(-) diff --git a/package-lock.json b/package-lock.json index df47a0301..d8c1914f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1198,16 +1198,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.16.0.tgz", - "integrity": "sha512-py1miT6iQpJcs1BiJjm54AMzeuMPBSPuKPlnT8HlfudbcS5rYeX5jajpLf3mrdRh9dA/Ec2FVUY0ifeVNDIhZw==", + "version": "7.16.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.16.1.tgz", + "integrity": "sha512-SxdPak/5bO0EnGktV05+Hq8oatjAYVY3Zh2bye9pGZy6+jwyR3LG3YKkV4YatlsgqXP28BTeVm9pqwJM96vf2A==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "7.16.0", - "@typescript-eslint/type-utils": "7.16.0", - "@typescript-eslint/utils": "7.16.0", - "@typescript-eslint/visitor-keys": "7.16.0", + "@typescript-eslint/scope-manager": "7.16.1", + "@typescript-eslint/type-utils": "7.16.1", + "@typescript-eslint/utils": "7.16.1", + "@typescript-eslint/visitor-keys": "7.16.1", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -1230,53 +1230,6 @@ } } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.16.0.tgz", - "integrity": "sha512-8gVv3kW6n01Q6TrI1cmTZ9YMFi3ucDT7i7aI5lEikk2ebk1AEjrwX8MDTdaX5D7fPXMBLvnsaa0IFTAu+jcfOw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "7.16.0", - "@typescript-eslint/visitor-keys": "7.16.0" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/types": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.16.0.tgz", - "integrity": "sha512-fecuH15Y+TzlUutvUl9Cc2XJxqdLr7+93SQIbcZfd4XRGGKoxyljK27b+kxKamjRkU7FYC6RrbSCg0ALcZn/xw==", - "dev": true, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.16.0.tgz", - "integrity": "sha512-rMo01uPy9C7XxG7AFsxa8zLnWXTF8N3PYclekWSrurvhwiw1eW88mrKiAYe6s53AUY57nTRz8dJsuuXdkAhzCg==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "7.16.0", - "eslint-visitor-keys": "^3.4.3" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/@typescript-eslint/parser": { "version": "7.16.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.16.1.tgz", @@ -1325,13 +1278,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.16.0.tgz", - "integrity": "sha512-j0fuUswUjDHfqV/UdW6mLtOQQseORqfdmoBNDFOqs9rvNVR2e+cmu6zJu/Ku4SDuqiJko6YnhwcL8x45r8Oqxg==", + "version": "7.16.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.16.1.tgz", + "integrity": "sha512-rbu/H2MWXN4SkjIIyWcmYBjlp55VT+1G3duFOIukTNFxr9PI35pLc2ydwAfejCEitCv4uztA07q0QWanOHC7dA==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "7.16.0", - "@typescript-eslint/utils": "7.16.0", + "@typescript-eslint/typescript-estree": "7.16.1", + "@typescript-eslint/utils": "7.16.1", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -1351,100 +1304,6 @@ } } }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/types": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.16.0.tgz", - "integrity": "sha512-fecuH15Y+TzlUutvUl9Cc2XJxqdLr7+93SQIbcZfd4XRGGKoxyljK27b+kxKamjRkU7FYC6RrbSCg0ALcZn/xw==", - "dev": true, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.16.0.tgz", - "integrity": "sha512-a5NTvk51ZndFuOLCh5OaJBELYc2O3Zqxfl3Js78VFE1zE46J2AaVuW+rEbVkQznjkmlzWsUI15BG5tQMixzZLw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "7.16.0", - "@typescript-eslint/visitor-keys": "7.16.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^1.3.0" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.16.0.tgz", - "integrity": "sha512-rMo01uPy9C7XxG7AFsxa8zLnWXTF8N3PYclekWSrurvhwiw1eW88mrKiAYe6s53AUY57nTRz8dJsuuXdkAhzCg==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "7.16.0", - "eslint-visitor-keys": "^3.4.3" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/@typescript-eslint/types": { "version": "7.16.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.16.1.tgz", @@ -1528,15 +1387,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.16.0.tgz", - "integrity": "sha512-PqP4kP3hb4r7Jav+NiRCntlVzhxBNWq6ZQ+zQwII1y/G/1gdIPeYDCKr2+dH6049yJQsWZiHU6RlwvIFBXXGNA==", + "version": "7.16.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.16.1.tgz", + "integrity": "sha512-WrFM8nzCowV0he0RlkotGDujx78xudsxnGMBHI88l5J8wEhED6yBwaSLP99ygfrzAjsQvcYQ94quDwI0d7E1fA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "7.16.0", - "@typescript-eslint/types": "7.16.0", - "@typescript-eslint/typescript-estree": "7.16.0" + "@typescript-eslint/scope-manager": "7.16.1", + "@typescript-eslint/types": "7.16.1", + "@typescript-eslint/typescript-estree": "7.16.1" }, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -1549,117 +1408,6 @@ "eslint": "^8.56.0" } }, - "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/scope-manager": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.16.0.tgz", - "integrity": "sha512-8gVv3kW6n01Q6TrI1cmTZ9YMFi3ucDT7i7aI5lEikk2ebk1AEjrwX8MDTdaX5D7fPXMBLvnsaa0IFTAu+jcfOw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "7.16.0", - "@typescript-eslint/visitor-keys": "7.16.0" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/types": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.16.0.tgz", - "integrity": "sha512-fecuH15Y+TzlUutvUl9Cc2XJxqdLr7+93SQIbcZfd4XRGGKoxyljK27b+kxKamjRkU7FYC6RrbSCg0ALcZn/xw==", - "dev": true, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.16.0.tgz", - "integrity": "sha512-a5NTvk51ZndFuOLCh5OaJBELYc2O3Zqxfl3Js78VFE1zE46J2AaVuW+rEbVkQznjkmlzWsUI15BG5tQMixzZLw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "7.16.0", - "@typescript-eslint/visitor-keys": "7.16.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^1.3.0" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.16.0.tgz", - "integrity": "sha512-rMo01uPy9C7XxG7AFsxa8zLnWXTF8N3PYclekWSrurvhwiw1eW88mrKiAYe6s53AUY57nTRz8dJsuuXdkAhzCg==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "7.16.0", - "eslint-visitor-keys": "^3.4.3" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/utils/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/@typescript-eslint/utils/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@typescript-eslint/utils/node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/@typescript-eslint/visitor-keys": { "version": "7.16.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.16.1.tgz", From 40c6d9c490a18a5efa5c232b1894d420efba15d6 Mon Sep 17 00:00:00 2001 From: John Nesky Date: Mon, 22 Jul 2024 09:21:51 -0700 Subject: [PATCH 04/90] fix: Enable blocks if user can't manually enable them. (#8354) * fix: Enable blocks if user can't manually enable them. * Only change the affected test method. --- core/block.ts | 19 +++++++++++++++++++ tests/mocha/blocks/procedures_test.js | 1 + 2 files changed, 20 insertions(+) diff --git a/core/block.ts b/core/block.ts index 52191d63c..6a911d557 100644 --- a/core/block.ts +++ b/core/block.ts @@ -1460,6 +1460,25 @@ export class Block implements IASTNodeLocation { * update whether the block is currently disabled for this reason. */ setDisabledReason(disabled: boolean, reason: string): void { + // Workspaces that were serialized before the reason for being disabled + // could be specified may have blocks that are disabled without a known + // reason. On being loaded, these blocks will default to having the manually + // disabled reason. However, if the user isn't allowed to manually disable + // or enable blocks, then this manually disabled reason cannot be removed. + // For backward compatibility with these legacy workspaces, when removing + // any disabled reason and the workspace does not allow manually disabling + // but the block is manually disabled, then remove the manually disabled + // reason in addition to the more specific reason. For example, when an + // orphaned block is no longer orphaned, the block should be enabled again. + if ( + !disabled && + !this.workspace.options.disable && + this.hasDisabledReason(constants.MANUALLY_DISABLED) && + reason != constants.MANUALLY_DISABLED + ) { + this.setDisabledReason(false, constants.MANUALLY_DISABLED); + } + if (this.disabledReasons.has(reason) !== disabled) { if (disabled) { this.disabledReasons.add(reason); diff --git a/tests/mocha/blocks/procedures_test.js b/tests/mocha/blocks/procedures_test.js index 684237006..600aefa6a 100644 --- a/tests/mocha/blocks/procedures_test.js +++ b/tests/mocha/blocks/procedures_test.js @@ -862,6 +862,7 @@ suite('Procedures', function () { 'if a procedure caller block was already disabled before ' + 'its definition was disabled, it is not reenabled', function () { + this.workspace.options.disable = true; const defBlock = createProcDefBlock(this.workspace); const callBlock = createProcCallBlock(this.workspace); this.clock.runAll(); From 625369ce7ed37c9a12303449c8e7b6b6057fb1b1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 09:39:59 -0700 Subject: [PATCH 05/90] chore(deps): bump rimraf from 5.0.7 to 5.0.9 (#8409) Bumps [rimraf](https://github.com/isaacs/rimraf) from 5.0.7 to 5.0.9. - [Changelog](https://github.com/isaacs/rimraf/blob/main/CHANGELOG.md) - [Commits](https://github.com/isaacs/rimraf/compare/v5.0.7...v5.0.9) --- updated-dependencies: - dependency-name: rimraf dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index d8c1914f6..257d44d27 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9835,9 +9835,9 @@ "dev": true }, "node_modules/rimraf": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.7.tgz", - "integrity": "sha512-nV6YcJo5wbLW77m+8KjH8aB/7/rxQy9SZ0HY5shnwULfS+9nmTtVXAJET5NdZmCzA4fPI/Hm1wo/Po/4mopOdg==", + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.9.tgz", + "integrity": "sha512-3i7b8OcswU6CpU8Ej89quJD4O98id7TtVM5U4Mybh84zQXdrFmDLouWBEEaD/QfO3gDDfH+AGFCGsR7kngzQnA==", "dev": true, "dependencies": { "glob": "^10.3.7" @@ -9846,7 +9846,7 @@ "rimraf": "dist/esm/bin.mjs" }, "engines": { - "node": ">=14.18" + "node": "14 >=14.20 || 16 >=16.20 || >=18" }, "funding": { "url": "https://github.com/sponsors/isaacs" From 505f28f1a5bf5b8ad65a1b7f333c98671a331996 Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Tue, 23 Jul 2024 15:24:40 +0000 Subject: [PATCH 06/90] Revert "chore: Pin node.js v22 to v22.4.1 in CI (#8393)" (#8398) This reverts commit 1e3d3fde1c3e5e668a5840579e07bb8fcfb83b25. --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 585a26c2d..c4ab688f8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,8 +18,7 @@ jobs: # TODO (#2114): re-enable osx build. # os: [ubuntu-latest, macos-latest] os: [ubuntu-latest] - # TODO(#8392): unpin v22 once npm issue fixed. - node-version: [18.x, 20.x, 22.4.1] + node-version: [18.x, 20.x, 22.x] # See supported Node.js release schedule at # https://nodejs.org/en/about/releases/ From ebb56b2ce814f113b469f4cf4fb7f76d7a3c4d99 Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Thu, 25 Jul 2024 17:25:24 +0100 Subject: [PATCH 07/90] docs(blocks): `block.ts` and `blocks/*` JSDoc / formatting / etc. cleanup (#8431) * docs(block): Improve documentation for well-known block methods Improve the JSDocs for the declarations of well-known block methods: - getDeveloperVariables - compose - decompose - saveConnections * docs(blocks): Improve block comments Fix JSDoc formatting in both core/block.ts and blocks/*, as well as making various other minor improvments. * chore(blocks): Remove one unexported const --- blocks/procedures.ts | 2 +- blocks/text.ts | 16 +++++++--------- core/block.ts | 36 +++++++++++++++++++++--------------- core/block_svg.ts | 20 +++++++++++++++++++- 4 files changed, 48 insertions(+), 26 deletions(-) diff --git a/blocks/procedures.ts b/blocks/procedures.ts index 1214eb55e..e2b7ba18f 100644 --- a/blocks/procedures.ts +++ b/blocks/procedures.ts @@ -1206,7 +1206,7 @@ blocks['procedures_callreturn'] = { this.appendDummyInput('TOPROW').appendField('', 'NAME'); this.setOutput(true); this.setStyle('procedure_blocks'); - // Tooltip is set in domToMutation. + // Tooltip is set in renameProcedure. this.setHelpUrl(Msg['PROCEDURES_CALLRETURN_HELPURL']); this.arguments_ = []; this.argumentVarModels_ = []; diff --git a/blocks/text.ts b/blocks/text.ts index 91a27005a..450e30087 100644 --- a/blocks/text.ts +++ b/blocks/text.ts @@ -438,6 +438,11 @@ const PROMPT_COMMON = { domToMutation: function (this: PromptCommonBlock, xmlElement: Element) { this.updateType_(xmlElement.getAttribute('type')!); }, + + // These blocks do not need JSO serialization hooks (saveExtraState + // and loadExtraState) because the state of this object is already + // encoded in the dropdown values. + // XML hooks are kept for backwards compatibility. }; blocks['text_prompt_ext'] = { @@ -468,16 +473,11 @@ blocks['text_prompt_ext'] = { : Msg['TEXT_PROMPT_TOOLTIP_NUMBER']; }); }, - - // This block does not need JSO serialization hooks (saveExtraState and - // loadExtraState) because the state of this object is already encoded in the - // dropdown values. - // XML hooks are kept for backwards compatibility. }; type PromptBlock = Block & PromptCommonMixin & QuoteImageMixin; -const TEXT_PROMPT_BLOCK = { +blocks['text_prompt'] = { ...PROMPT_COMMON, /** * Block for prompt function (internal message). @@ -520,8 +520,6 @@ const TEXT_PROMPT_BLOCK = { }, }; -blocks['text_prompt'] = TEXT_PROMPT_BLOCK; - blocks['text_count'] = { /** * Block for counting how many times one string appears within another string. @@ -666,7 +664,7 @@ const QUOTE_IMAGE_MIXIN = { * closing double quote. The selected quote will be adapted for RTL blocks. * * @param open If the image should be open quote (“ in LTR). - * Otherwise, a closing quote is used (” in LTR). + * Otherwise, a closing quote is used (” in LTR). * @returns The new field. */ newQuote_: function (this: QuoteImageBlock, open: boolean): FieldImage { diff --git a/core/block.ts b/core/block.ts index 6a911d557..6db948e48 100644 --- a/core/block.ts +++ b/core/block.ts @@ -143,24 +143,31 @@ export class Block implements IASTNodeLocation { suppressPrefixSuffix: boolean | null = false; /** - * An optional property for declaring developer variables. Return a list of - * variable names for use by generators. Developer variables are never - * shown to the user, but are declared as global variables in the generated - * code. + * An optional method for declaring developer variables, to be used + * by generators. Developer variables are never shown to the user, + * but are declared as global variables in the generated code. + * + * @returns a list of developer variable names. */ getDeveloperVariables?: () => string[]; /** - * An optional function that reconfigures the block based on the contents of - * the mutator dialog. + * An optional method that reconfigures the block based on the + * contents of the mutator dialog. + * + * @param rootBlock The root block in the mutator flyout. */ - compose?: (p1: Block) => void; + compose?: (rootBlock: Block) => void; /** - * An optional function that populates the mutator's dialog with - * this block's components. + * An optional function that populates the mutator flyout with + * blocks representing this block's configuration. + * + * @param workspace The mutator flyout's workspace. + * @returns The root block created in the flyout's workspace. */ - decompose?: (p1: Workspace) => Block; + decompose?: (workspace: Workspace) => Block; + id: string; outputConnection: Connection | null = null; nextConnection: Connection | null = null; @@ -716,7 +723,7 @@ export class Block implements IASTNodeLocation { } // Check that block is connected to new parent if new parent is not null and - // that block is not connected to superior one if new parent is null. + // that block is not connected to superior one if new parent is null. const targetBlock = (this.previousConnection && this.previousConnection.targetBlock()) || (this.outputConnection && this.outputConnection.targetBlock()); @@ -734,14 +741,13 @@ export class Block implements IASTNodeLocation { } // This block hasn't actually moved on-screen, so there's no need to - // update - // its connection locations. + // update its connection locations. if (this.parentBlock_) { // Remove this block from the old parent's child list. arrayUtils.removeElem(this.parentBlock_.childBlocks_, this); } else { - // New parent must be non-null so remove this block from the workspace's - // list of top-most blocks. + // New parent must be non-null so remove this block from the + // workspace's list of top-most blocks. this.workspace.removeTopBlock(this); } diff --git a/core/block_svg.ts b/core/block_svg.ts index 79f548caf..1a96d166a 100644 --- a/core/block_svg.ts +++ b/core/block_svg.ts @@ -92,7 +92,25 @@ export class BlockSvg static readonly COLLAPSED_WARNING_ID = 'TEMP_COLLAPSED_WARNING_'; override decompose?: (p1: Workspace) => BlockSvg; // override compose?: ((p1: BlockSvg) => void)|null; - saveConnections?: (p1: BlockSvg) => void; + + /** + * An optional method which saves a record of blocks connected to + * this block so they can be later restored after this block is + * recoomposed (reconfigured). Typically records the connected + * blocks on properties on blocks in the mutator flyout, so that + * rearranging those component blocks will automatically rearrange + * the corresponding connected blocks on this block after this block + * is recomposed. + * + * To keep the saved connection information up-to-date, MutatorIcon + * arranges for an event listener to call this method any time the + * mutator flyout is open and a change occurs on this block's + * workspace. + * + * @param rootBlock The root block in the mutator flyout. + */ + saveConnections?: (rootBlock: BlockSvg) => void; + customContextMenu?: ( p1: Array, ) => void; From 504de6a98c741c902a00d6534eb69f7c31e45b9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=84=8D=F0=9D=95=A0=F0=9D=95=9D=F0=9D=95=9D=F0=9D=95=A0?= =?UTF-8?q?=F0=9D=95=A8=20=F0=9D=95=84=F0=9D=95=92=F0=9D=95=9F?= Date: Fri, 26 Jul 2024 00:09:10 +0300 Subject: [PATCH 08/90] fix: drag strategy only clear group id set by us (#8355) Add a condition check so that we don't unset the group ID that is not set by us. Otherwise the multi-select plugin undo/redo will be broken (apply individually instead of all together) Signed-off-by: Hollow Man --- core/dragging/block_drag_strategy.ts | 10 ++++++++-- core/dragging/bubble_drag_strategy.ts | 10 ++++++++-- core/dragging/comment_drag_strategy.ts | 10 ++++++++-- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/core/dragging/block_drag_strategy.ts b/core/dragging/block_drag_strategy.ts index dc136d814..2afdba51f 100644 --- a/core/dragging/block_drag_strategy.ts +++ b/core/dragging/block_drag_strategy.ts @@ -61,6 +61,9 @@ export class BlockDragStrategy implements IDragStrategy { */ private dragOffset = new Coordinate(0, 0); + /** Was there already an event group in progress when the drag started? */ + private inGroup: boolean = false; + constructor(private block: BlockSvg) { this.workspace = block.workspace; } @@ -92,7 +95,8 @@ export class BlockDragStrategy implements IDragStrategy { } this.dragging = true; - if (!eventUtils.getGroup()) { + this.inGroup = !!eventUtils.getGroup(); + if (!this.inGroup) { eventUtils.setGroup(true); } this.fireDragStartEvent(); @@ -389,7 +393,9 @@ export class BlockDragStrategy implements IDragStrategy { this.connectionPreviewer!.dispose(); this.workspace.setResizesEnabled(true); - eventUtils.setGroup(false); + if (!this.inGroup) { + eventUtils.setGroup(false); + } } /** Connects the given candidate connections. */ diff --git a/core/dragging/bubble_drag_strategy.ts b/core/dragging/bubble_drag_strategy.ts index 7ffccddc1..f388bb94c 100644 --- a/core/dragging/bubble_drag_strategy.ts +++ b/core/dragging/bubble_drag_strategy.ts @@ -13,6 +13,9 @@ import * as layers from '../layers.js'; export class BubbleDragStrategy implements IDragStrategy { private startLoc: Coordinate | null = null; + /** Was there already an event group in progress when the drag started? */ + private inGroup: boolean = false; + constructor( private bubble: IBubble, private workspace: WorkspaceSvg, @@ -23,7 +26,8 @@ export class BubbleDragStrategy implements IDragStrategy { } startDrag(): void { - if (!eventUtils.getGroup()) { + this.inGroup = !!eventUtils.getGroup(); + if (!this.inGroup) { eventUtils.setGroup(true); } this.startLoc = this.bubble.getRelativeToSurfaceXY(); @@ -38,7 +42,9 @@ export class BubbleDragStrategy implements IDragStrategy { endDrag(): void { this.workspace.setResizesEnabled(true); - eventUtils.setGroup(false); + if (!this.inGroup) { + eventUtils.setGroup(false); + } this.workspace .getLayerManager() diff --git a/core/dragging/comment_drag_strategy.ts b/core/dragging/comment_drag_strategy.ts index 2ad5fa144..2197d37f2 100644 --- a/core/dragging/comment_drag_strategy.ts +++ b/core/dragging/comment_drag_strategy.ts @@ -17,6 +17,9 @@ export class CommentDragStrategy implements IDragStrategy { private workspace: WorkspaceSvg; + /** Was there already an event group in progress when the drag started? */ + private inGroup: boolean = false; + constructor(private comment: RenderedWorkspaceComment) { this.workspace = comment.workspace; } @@ -26,7 +29,8 @@ export class CommentDragStrategy implements IDragStrategy { } startDrag(): void { - if (!eventUtils.getGroup()) { + this.inGroup = !!eventUtils.getGroup(); + if (!this.inGroup) { eventUtils.setGroup(true); } this.fireDragStartEvent(); @@ -52,7 +56,9 @@ export class CommentDragStrategy implements IDragStrategy { this.comment.snapToGrid(); this.workspace.setResizesEnabled(true); - eventUtils.setGroup(false); + if (!this.inGroup) { + eventUtils.setGroup(false); + } } /** Fire a UI event at the start of a comment drag. */ From ee4a9dd8a1fabd3aeda25fecac21b06de968dace Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Jul 2024 19:28:10 +0100 Subject: [PATCH 09/90] chore(deps): bump prettier from 3.3.2 to 3.3.3 (#8410) Bumps [prettier](https://github.com/prettier/prettier) from 3.3.2 to 3.3.3. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/3.3.2...3.3.3) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index ef27c3b64..2e9e2b264 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,7 +47,7 @@ "markdown-tables-to-json": "^0.1.7", "mocha": "^10.0.0", "patch-package": "^8.0.0", - "prettier": "3.3.2", + "prettier": "3.3.3", "readline-sync": "^1.4.10", "rimraf": "^5.0.0", "typescript": "^5.3.3", @@ -9344,9 +9344,9 @@ } }, "node_modules/prettier": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", - "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" diff --git a/package.json b/package.json index c0a55f201..512a8203c 100644 --- a/package.json +++ b/package.json @@ -134,7 +134,7 @@ "markdown-tables-to-json": "^0.1.7", "mocha": "^10.0.0", "patch-package": "^8.0.0", - "prettier": "3.3.2", + "prettier": "3.3.3", "readline-sync": "^1.4.10", "rimraf": "^5.0.0", "typescript": "^5.3.3", From 1d8e31802832443b0920d2b67d75b585198959bb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 10:26:32 -0700 Subject: [PATCH 10/90] chore(deps): bump @typescript-eslint/parser from 7.16.1 to 7.17.0 (#8442) Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 7.16.1 to 7.17.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.17.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 126 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 118 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2e9e2b264..b030aec0e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1319,16 +1319,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "7.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.16.1.tgz", - "integrity": "sha512-u+1Qx86jfGQ5i4JjK33/FnawZRpsLxRnKzGE6EABZ40KxVT/vWsiZFEBBHjFOljmmV3MBYOHEKi0Jm9hbAOClA==", + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.17.0.tgz", + "integrity": "sha512-puiYfGeg5Ydop8eusb/Hy1k7QmOU6X3nvsqCgzrB2K4qMavK//21+PzNE8qeECgNOIoertJPUC1SpegHDI515A==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/scope-manager": "7.16.1", - "@typescript-eslint/types": "7.16.1", - "@typescript-eslint/typescript-estree": "7.16.1", - "@typescript-eslint/visitor-keys": "7.16.1", + "@typescript-eslint/scope-manager": "7.17.0", + "@typescript-eslint/types": "7.17.0", + "@typescript-eslint/typescript-estree": "7.17.0", + "@typescript-eslint/visitor-keys": "7.17.0", "debug": "^4.3.4" }, "engines": { @@ -1347,6 +1346,117 @@ } } }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.17.0.tgz", + "integrity": "sha512-0P2jTTqyxWp9HiKLu/Vemr2Rg1Xb5B7uHItdVZ6iAenXmPo4SZ86yOPCJwMqpCyaMiEHTNqizHfsbmCFT1x9SA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.17.0", + "@typescript-eslint/visitor-keys": "7.17.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.17.0.tgz", + "integrity": "sha512-a29Ir0EbyKTKHnZWbNsrc/gqfIBqYPwj3F2M+jWE/9bqfEHg0AMtXzkbUkOG6QgEScxh2+Pz9OXe11jHDnHR7A==", + "dev": true, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.17.0.tgz", + "integrity": "sha512-72I3TGq93t2GoSBWI093wmKo0n6/b7O4j9o8U+f65TVD0FS6bI2180X5eGEr8MA8PhKMvYe9myZJquUT2JkCZw==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.17.0", + "@typescript-eslint/visitor-keys": "7.17.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.17.0.tgz", + "integrity": "sha512-RVGC9UhPOCsfCdI9pU++K4nD7to+jTcMIbXTSOcrLqUEW6gF2pU1UUbYJKc9cvcRSK1UDeMJ7pdMxf4bhMpV/A==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.17.0", + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@typescript-eslint/scope-manager": { "version": "7.16.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.16.1.tgz", From 0f7418622748e802b82279fd0e46e30f5d98b8d3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 10:27:20 -0700 Subject: [PATCH 11/90] chore(deps): bump @typescript-eslint/eslint-plugin from 7.16.1 to 7.17.0 (#8445) Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 7.16.1 to 7.17.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.17.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 288 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 270 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index b030aec0e..c4e11db5b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1286,16 +1286,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "7.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.16.1.tgz", - "integrity": "sha512-SxdPak/5bO0EnGktV05+Hq8oatjAYVY3Zh2bye9pGZy6+jwyR3LG3YKkV4YatlsgqXP28BTeVm9pqwJM96vf2A==", + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.17.0.tgz", + "integrity": "sha512-pyiDhEuLM3PuANxH7uNYan1AaFs5XE0zw1hq69JBvGvE7gSuEoQl1ydtEe/XQeoC3GQxLXyOVa5kNOATgM638A==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "7.16.1", - "@typescript-eslint/type-utils": "7.16.1", - "@typescript-eslint/utils": "7.16.1", - "@typescript-eslint/visitor-keys": "7.16.1", + "@typescript-eslint/scope-manager": "7.17.0", + "@typescript-eslint/type-utils": "7.17.0", + "@typescript-eslint/utils": "7.17.0", + "@typescript-eslint/visitor-keys": "7.17.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -1318,6 +1318,53 @@ } } }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.17.0.tgz", + "integrity": "sha512-0P2jTTqyxWp9HiKLu/Vemr2Rg1Xb5B7uHItdVZ6iAenXmPo4SZ86yOPCJwMqpCyaMiEHTNqizHfsbmCFT1x9SA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.17.0", + "@typescript-eslint/visitor-keys": "7.17.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/types": { + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.17.0.tgz", + "integrity": "sha512-a29Ir0EbyKTKHnZWbNsrc/gqfIBqYPwj3F2M+jWE/9bqfEHg0AMtXzkbUkOG6QgEScxh2+Pz9OXe11jHDnHR7A==", + "dev": true, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.17.0.tgz", + "integrity": "sha512-RVGC9UhPOCsfCdI9pU++K4nD7to+jTcMIbXTSOcrLqUEW6gF2pU1UUbYJKc9cvcRSK1UDeMJ7pdMxf4bhMpV/A==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.17.0", + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/@typescript-eslint/parser": { "version": "7.17.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.17.0.tgz", @@ -1476,13 +1523,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "7.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.16.1.tgz", - "integrity": "sha512-rbu/H2MWXN4SkjIIyWcmYBjlp55VT+1G3duFOIukTNFxr9PI35pLc2ydwAfejCEitCv4uztA07q0QWanOHC7dA==", + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.17.0.tgz", + "integrity": "sha512-XD3aaBt+orgkM/7Cei0XNEm1vwUxQ958AOLALzPlbPqb8C1G8PZK85tND7Jpe69Wualri81PLU+Zc48GVKIMMA==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "7.16.1", - "@typescript-eslint/utils": "7.16.1", + "@typescript-eslint/typescript-estree": "7.17.0", + "@typescript-eslint/utils": "7.17.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -1502,6 +1549,100 @@ } } }, + "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/types": { + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.17.0.tgz", + "integrity": "sha512-a29Ir0EbyKTKHnZWbNsrc/gqfIBqYPwj3F2M+jWE/9bqfEHg0AMtXzkbUkOG6QgEScxh2+Pz9OXe11jHDnHR7A==", + "dev": true, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": { + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.17.0.tgz", + "integrity": "sha512-72I3TGq93t2GoSBWI093wmKo0n6/b7O4j9o8U+f65TVD0FS6bI2180X5eGEr8MA8PhKMvYe9myZJquUT2JkCZw==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.17.0", + "@typescript-eslint/visitor-keys": "7.17.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/visitor-keys": { + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.17.0.tgz", + "integrity": "sha512-RVGC9UhPOCsfCdI9pU++K4nD7to+jTcMIbXTSOcrLqUEW6gF2pU1UUbYJKc9cvcRSK1UDeMJ7pdMxf4bhMpV/A==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.17.0", + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@typescript-eslint/types": { "version": "7.16.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.16.1.tgz", @@ -1585,15 +1726,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "7.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.16.1.tgz", - "integrity": "sha512-WrFM8nzCowV0he0RlkotGDujx78xudsxnGMBHI88l5J8wEhED6yBwaSLP99ygfrzAjsQvcYQ94quDwI0d7E1fA==", + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.17.0.tgz", + "integrity": "sha512-r+JFlm5NdB+JXc7aWWZ3fKSm1gn0pkswEwIYsrGPdsT2GjsRATAKXiNtp3vgAAO1xZhX8alIOEQnNMl3kbTgJw==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "7.16.1", - "@typescript-eslint/types": "7.16.1", - "@typescript-eslint/typescript-estree": "7.16.1" + "@typescript-eslint/scope-manager": "7.17.0", + "@typescript-eslint/types": "7.17.0", + "@typescript-eslint/typescript-estree": "7.17.0" }, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -1606,6 +1747,117 @@ "eslint": "^8.56.0" } }, + "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/scope-manager": { + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.17.0.tgz", + "integrity": "sha512-0P2jTTqyxWp9HiKLu/Vemr2Rg1Xb5B7uHItdVZ6iAenXmPo4SZ86yOPCJwMqpCyaMiEHTNqizHfsbmCFT1x9SA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.17.0", + "@typescript-eslint/visitor-keys": "7.17.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/types": { + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.17.0.tgz", + "integrity": "sha512-a29Ir0EbyKTKHnZWbNsrc/gqfIBqYPwj3F2M+jWE/9bqfEHg0AMtXzkbUkOG6QgEScxh2+Pz9OXe11jHDnHR7A==", + "dev": true, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree": { + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.17.0.tgz", + "integrity": "sha512-72I3TGq93t2GoSBWI093wmKo0n6/b7O4j9o8U+f65TVD0FS6bI2180X5eGEr8MA8PhKMvYe9myZJquUT2JkCZw==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.17.0", + "@typescript-eslint/visitor-keys": "7.17.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/visitor-keys": { + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.17.0.tgz", + "integrity": "sha512-RVGC9UhPOCsfCdI9pU++K4nD7to+jTcMIbXTSOcrLqUEW6gF2pU1UUbYJKc9cvcRSK1UDeMJ7pdMxf4bhMpV/A==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.17.0", + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@typescript-eslint/visitor-keys": { "version": "7.16.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.16.1.tgz", From e2310a4fed429e27ccc514a4aa45b7766eda5bfe Mon Sep 17 00:00:00 2001 From: John Nesky Date: Mon, 29 Jul 2024 10:30:29 -0700 Subject: [PATCH 12/90] fix: Codify component weights with toolbox in front of flyouts. (#8432) --- core/component_manager.ts | 12 ++++++++++++ core/flyout_base.ts | 2 +- core/toolbox/toolbox.ts | 2 +- core/trashcan.ts | 2 +- core/zoom_controls.ts | 2 +- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/core/component_manager.ts b/core/component_manager.ts index b9654c94e..fb89c38ae 100644 --- a/core/component_manager.ts +++ b/core/component_manager.ts @@ -224,6 +224,16 @@ export class ComponentManager { } export namespace ComponentManager { + export enum ComponentWeight { + // The toolbox weight is lower (higher precedence) than the flyout, so that + // if both are under the pointer, the toolbox takes precedence even though + // the flyout's drag target area is large enough to include the toolbox. + TOOLBOX_WEIGHT = 0, + FLYOUT_WEIGHT = 1, + TRASHCAN_WEIGHT = 2, + ZOOM_CONTROLS_WEIGHT = 3, + } + /** An object storing component information. */ export interface ComponentDatum { component: IComponent; @@ -232,4 +242,6 @@ export namespace ComponentManager { } } +export type ComponentWeight = ComponentManager.ComponentWeight; +export const ComponentWeight = ComponentManager.ComponentWeight; export type ComponentDatum = ComponentManager.ComponentDatum; diff --git a/core/flyout_base.ts b/core/flyout_base.ts index 18f84480c..27ad0abf5 100644 --- a/core/flyout_base.ts +++ b/core/flyout_base.ts @@ -427,7 +427,7 @@ export abstract class Flyout targetWorkspace.getComponentManager().addComponent({ component: this, - weight: 1, + weight: ComponentManager.ComponentWeight.FLYOUT_WEIGHT, capabilities: [ ComponentManager.Capability.AUTOHIDEABLE, ComponentManager.Capability.DELETE_AREA, diff --git a/core/toolbox/toolbox.ts b/core/toolbox/toolbox.ts index e0fb62e23..578a62b0e 100644 --- a/core/toolbox/toolbox.ts +++ b/core/toolbox/toolbox.ts @@ -157,7 +157,7 @@ export class Toolbox themeManager.subscribe(this.HtmlDiv, 'toolboxForegroundColour', 'color'); this.workspace_.getComponentManager().addComponent({ component: this, - weight: 1, + weight: ComponentManager.ComponentWeight.TOOLBOX_WEIGHT, capabilities: [ ComponentManager.Capability.AUTOHIDEABLE, ComponentManager.Capability.DELETE_AREA, diff --git a/core/trashcan.ts b/core/trashcan.ts index 050f506a4..d4629dcae 100644 --- a/core/trashcan.ts +++ b/core/trashcan.ts @@ -247,7 +247,7 @@ export class Trashcan } this.workspace.getComponentManager().addComponent({ component: this, - weight: 1, + weight: ComponentManager.ComponentWeight.TRASHCAN_WEIGHT, capabilities: [ ComponentManager.Capability.AUTOHIDEABLE, ComponentManager.Capability.DELETE_AREA, diff --git a/core/zoom_controls.ts b/core/zoom_controls.ts index 6534c7322..c93d99de4 100644 --- a/core/zoom_controls.ts +++ b/core/zoom_controls.ts @@ -116,7 +116,7 @@ export class ZoomControls implements IPositionable { init() { this.workspace.getComponentManager().addComponent({ component: this, - weight: 2, + weight: ComponentManager.ComponentWeight.ZOOM_CONTROLS_WEIGHT, capabilities: [ComponentManager.Capability.POSITIONABLE], }); this.initialized = true; From 612b8c89dc391531e6a0e442bed1847b5dec80ef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 Jul 2024 00:51:41 +0100 Subject: [PATCH 13/90] chore(deps): bump jsdom from 24.1.0 to 24.1.1 (#8444) Bumps [jsdom](https://github.com/jsdom/jsdom) from 24.1.0 to 24.1.1. - [Release notes](https://github.com/jsdom/jsdom/releases) - [Changelog](https://github.com/jsdom/jsdom/blob/main/Changelog.md) - [Commits](https://github.com/jsdom/jsdom/compare/24.1.0...24.1.1) --- updated-dependencies: - dependency-name: jsdom dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 34 +++++++++++++++++----------------- package.json | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index c4e11db5b..aa836198a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "jsdom": "24.1.0" + "jsdom": "24.1.1" }, "devDependencies": { "@blockly/block-test": "^6.0.4", @@ -7074,9 +7074,9 @@ } }, "node_modules/https-proxy-agent": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", - "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", + "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", "dependencies": { "agent-base": "^7.0.2", "debug": "4" @@ -7633,9 +7633,9 @@ } }, "node_modules/jsdom": { - "version": "24.1.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-24.1.0.tgz", - "integrity": "sha512-6gpM7pRXCwIOKxX47cgOyvyQDN/Eh0f1MeKySBV2xGdKtqJBLj8P25eY3EVCWo2mglDDzozR2r2MW4T+JiNUZA==", + "version": "24.1.1", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-24.1.1.tgz", + "integrity": "sha512-5O1wWV99Jhq4DV7rCLIoZ/UIhyQeDR7wHVyZAHAshbrvZsLs+Xzz7gtwnlJTJDjleiTKh54F4dXrX70vJQTyJQ==", "dependencies": { "cssstyle": "^4.0.1", "data-urls": "^5.0.0", @@ -7643,11 +7643,11 @@ "form-data": "^4.0.0", "html-encoding-sniffer": "^4.0.0", "http-proxy-agent": "^7.0.2", - "https-proxy-agent": "^7.0.4", + "https-proxy-agent": "^7.0.5", "is-potential-custom-element-name": "^1.0.1", - "nwsapi": "^2.2.10", + "nwsapi": "^2.2.12", "parse5": "^7.1.2", - "rrweb-cssom": "^0.7.0", + "rrweb-cssom": "^0.7.1", "saxes": "^6.0.0", "symbol-tree": "^3.2.4", "tough-cookie": "^4.1.4", @@ -7656,7 +7656,7 @@ "whatwg-encoding": "^3.1.1", "whatwg-mimetype": "^4.0.0", "whatwg-url": "^14.0.0", - "ws": "^8.17.0", + "ws": "^8.18.0", "xml-name-validator": "^5.0.0" }, "engines": { @@ -7738,9 +7738,9 @@ } }, "node_modules/jsdom/node_modules/ws": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", - "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", "engines": { "node": ">=10.0.0" }, @@ -8898,9 +8898,9 @@ } }, "node_modules/nwsapi": { - "version": "2.2.10", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.10.tgz", - "integrity": "sha512-QK0sRs7MKv0tKe1+5uZIQk/C8XGza4DAnztJG8iD+TpJIORARrCxczA738awHrZoHeTjSSoHqao2teO0dC/gFQ==" + "version": "2.2.12", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.12.tgz", + "integrity": "sha512-qXDmcVlZV4XRtKFzddidpfVP4oMSGhga+xdMc25mv8kaLUHtgzCDhUxkrN8exkGdTlLNaXj7CV3GtON7zuGZ+w==" }, "node_modules/object-assign": { "version": "4.1.1", diff --git a/package.json b/package.json index 512a8203c..e81bfb875 100644 --- a/package.json +++ b/package.json @@ -142,7 +142,7 @@ "yargs": "^17.2.1" }, "dependencies": { - "jsdom": "24.1.0" + "jsdom": "24.1.1" }, "engines": { "node": ">=18" From f020b54fd08e30ec12d9749e4272ca20db26a13e Mon Sep 17 00:00:00 2001 From: Jeremiah Saunders <46662314+UCYT5040@users.noreply.github.com> Date: Fri, 2 Aug 2024 15:09:30 -0500 Subject: [PATCH 14/90] fix: bring comments and bubbles to the front on click (#8451) * Bring comment to the block layer when clicked * Bring bubbles to front when clicked --- core/bubbles/bubble.ts | 3 ++- core/comments/rendered_workspace_comment.ts | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/core/bubbles/bubble.ts b/core/bubbles/bubble.ts index 35b9e7dde..e86f5a856 100644 --- a/core/bubbles/bubble.ts +++ b/core/bubbles/bubble.ts @@ -212,9 +212,10 @@ export abstract class Bubble implements IBubble, ISelectable { this.background.setAttribute('fill', colour); } - /** Passes the pointer event off to the gesture system. */ + /** Brings the bubble to the front and passes the pointer event off to the gesture system. */ private onMouseDown(e: PointerEvent) { this.workspace.getGesture(e)?.handleBubbleStart(e, this); + this.bringToFront(); common.setSelected(this); } diff --git a/core/comments/rendered_workspace_comment.ts b/core/comments/rendered_workspace_comment.ts index 79caf6a1d..7cc643808 100644 --- a/core/comments/rendered_workspace_comment.ts +++ b/core/comments/rendered_workspace_comment.ts @@ -28,6 +28,7 @@ import { import {IContextMenu} from '../interfaces/i_contextmenu.js'; import * as contextMenu from '../contextmenu.js'; import {ContextMenuRegistry} from '../contextmenu_registry.js'; +import * as layers from '../layers.js'; export class RenderedWorkspaceComment extends WorkspaceComment @@ -208,6 +209,7 @@ export class RenderedWorkspaceComment const gesture = this.workspace.getGesture(e); if (gesture) { gesture.handleCommentStart(e, this); + this.workspace.getLayerManager()?.append(this, layers.BLOCK); common.setSelected(this); } } From 159c5c4d7d737f36bfd25b050b006eeabc56cde6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 08:57:59 -0700 Subject: [PATCH 15/90] chore(deps): bump rimraf from 5.0.9 to 5.0.10 (#8461) Bumps [rimraf](https://github.com/isaacs/rimraf) from 5.0.9 to 5.0.10. - [Changelog](https://github.com/isaacs/rimraf/blob/main/CHANGELOG.md) - [Commits](https://github.com/isaacs/rimraf/compare/v5.0.9...v5.0.10) --- updated-dependencies: - dependency-name: rimraf dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 113 ++-------------------------------------------- 1 file changed, 3 insertions(+), 110 deletions(-) diff --git a/package-lock.json b/package-lock.json index aa836198a..596222b2b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1504,24 +1504,6 @@ "node": ">=10" } }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "7.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.16.1.tgz", - "integrity": "sha512-nYpyv6ALte18gbMz323RM+vpFpTjfNdyakbf3nsLvF43uF9KeNC289SUEW3QLZ1xPtyINJ1dIsZOuWuSRIWygw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "7.16.1", - "@typescript-eslint/visitor-keys": "7.16.1" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/@typescript-eslint/type-utils": { "version": "7.17.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.17.0.tgz", @@ -1657,74 +1639,6 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "7.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.16.1.tgz", - "integrity": "sha512-0vFPk8tMjj6apaAZ1HlwM8w7jbghC8jc1aRNJG5vN8Ym5miyhTQGMqU++kuBFDNKe9NcPeZ6x0zfSzV8xC1UlQ==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "@typescript-eslint/types": "7.16.1", - "@typescript-eslint/visitor-keys": "7.16.1", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^1.3.0" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/@typescript-eslint/utils": { "version": "7.17.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.17.0.tgz", @@ -1858,24 +1772,6 @@ "node": ">=10" } }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "7.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.16.1.tgz", - "integrity": "sha512-Qlzzx4sE4u3FsHTPQAAQFJFNOuqtuY0LFrZHwQ8IHK705XxBiWOFkfKRWu6niB7hwfgnwIpO4jTC75ozW1PHWg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "7.16.1", - "eslint-visitor-keys": "^3.4.3" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/@ungap/structured-clone": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", @@ -10299,9 +10195,9 @@ "dev": true }, "node_modules/rimraf": { - "version": "5.0.9", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.9.tgz", - "integrity": "sha512-3i7b8OcswU6CpU8Ej89quJD4O98id7TtVM5U4Mybh84zQXdrFmDLouWBEEaD/QfO3gDDfH+AGFCGsR7kngzQnA==", + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz", + "integrity": "sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==", "dev": true, "dependencies": { "glob": "^10.3.7" @@ -10309,9 +10205,6 @@ "bin": { "rimraf": "dist/esm/bin.mjs" }, - "engines": { - "node": "14 >=14.20 || 16 >=16.20 || >=18" - }, "funding": { "url": "https://github.com/sponsors/isaacs" } From cd31edbd9afdc443e57cfe4b6e0cb035cf3f2251 Mon Sep 17 00:00:00 2001 From: John Nesky Date: Mon, 5 Aug 2024 12:02:58 -0700 Subject: [PATCH 16/90] fix: Update dev-tools and remove toolbox category tests Colour and Angles. (#8457) --- package-lock.json | 54 +++++++++++------------- package.json | 2 +- tests/browser/test/toolbox_drag_test.mjs | 2 - 3 files changed, 25 insertions(+), 33 deletions(-) diff --git a/package-lock.json b/package-lock.json index 596222b2b..2b72eff83 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ }, "devDependencies": { "@blockly/block-test": "^6.0.4", - "@blockly/dev-tools": "^8.0.4", + "@blockly/dev-tools": "^8.0.6", "@blockly/theme-modern": "^6.0.3", "@hyperjump/browser": "^1.1.4", "@hyperjump/json-schema": "^1.5.0", @@ -80,11 +80,10 @@ } }, "node_modules/@blockly/block-test": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/@blockly/block-test/-/block-test-6.0.4.tgz", - "integrity": "sha512-T8uod/uIt3QSvS5nIRGTa6i3h/UZXWJPUOiNY+RW0/azHZLBSOH8udyw1a22u9iOSpA7gDmw3WBbFgooCytDcw==", + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/@blockly/block-test/-/block-test-6.0.5.tgz", + "integrity": "sha512-k71CGCM6A7XZFyFQL/cnZkylhtfCgf3wTTG9Jymt7bkGZR6jVV1FSZYk0vaZ4tj+T2goqc8gb9VA1Jn8YWmoFA==", "dev": true, - "license": "Apache 2.0", "engines": { "node": ">=8.17.0" }, @@ -93,17 +92,16 @@ } }, "node_modules/@blockly/dev-tools": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/@blockly/dev-tools/-/dev-tools-8.0.4.tgz", - "integrity": "sha512-YTb3dj8msWWz4hfpQTRIE3NLX2xbTjkluuazA55jOBWSnkPRo0ZeCmjMVwOAG3GECBrjt3IanwuNIuwwBLkbkg==", + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/@blockly/dev-tools/-/dev-tools-8.0.6.tgz", + "integrity": "sha512-jC/XG7KKHqt1evxW/2/cnEgNEUsAzigsFjPNqwgCTyouJTORMxPDx/+CDIo3VPfRf2XFkEb/+KecjZz4SC+ToA==", "dev": true, - "license": "Apache-2.0", "dependencies": { - "@blockly/block-test": "^6.0.4", - "@blockly/theme-dark": "^7.0.3", - "@blockly/theme-deuteranopia": "^6.0.3", - "@blockly/theme-highcontrast": "^6.0.3", - "@blockly/theme-tritanopia": "^6.0.3", + "@blockly/block-test": "^6.0.5", + "@blockly/theme-dark": "^7.0.4", + "@blockly/theme-deuteranopia": "^6.0.4", + "@blockly/theme-highcontrast": "^6.0.4", + "@blockly/theme-tritanopia": "^6.0.4", "chai": "^4.2.0", "dat.gui": "^0.7.7", "lodash.assign": "^4.2.0", @@ -188,11 +186,10 @@ } }, "node_modules/@blockly/theme-dark": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/@blockly/theme-dark/-/theme-dark-7.0.3.tgz", - "integrity": "sha512-lRV9V5vjijbJAlUdZqtEhUt81OjHjZK8vagxir1cUqTrZ/+MNS2m7wkhIVPba4RWInJ1LY/nHEoQn6demZqRRQ==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/@blockly/theme-dark/-/theme-dark-7.0.4.tgz", + "integrity": "sha512-HJgP+3g5YYt8Zqe7DSstT0mM13BgsSKwuXNSD8iC7nNxldKu+uEWcoOdAIOy3oLifmnDJ6cYk924+KM6JLUnhQ==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=8.17.0" }, @@ -201,11 +198,10 @@ } }, "node_modules/@blockly/theme-deuteranopia": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/@blockly/theme-deuteranopia/-/theme-deuteranopia-6.0.3.tgz", - "integrity": "sha512-56nkKRoRMzArtz14sMp4sQ8nd2oYQGToadAzx9JfOl0otx2RoeZLnMnZlKa6ZeTsdJXspPRfkrwHcSyuDTA/6g==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@blockly/theme-deuteranopia/-/theme-deuteranopia-6.0.4.tgz", + "integrity": "sha512-8nQ6Q+eRpHOA5ZSUWShPavYBE/TDzKrSEW5F2flpYTM/Yepyv55d8hKm/0ZxxKPbYO7deqx2iwfriAVFHwpDOQ==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=8.17.0" }, @@ -214,11 +210,10 @@ } }, "node_modules/@blockly/theme-highcontrast": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/@blockly/theme-highcontrast/-/theme-highcontrast-6.0.3.tgz", - "integrity": "sha512-AXaB6ELmOZ+2z8ENbdaFDGVorNmcLn10JE9+fMICGTKBTs0T+N5LYH7q7dok04qrV3ZTrhw+rV8Xxp9tYio0Cw==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@blockly/theme-highcontrast/-/theme-highcontrast-6.0.4.tgz", + "integrity": "sha512-c9EBTQbOcBfOun8VRJsRNt8BvMI1Y6K2KZr6XIX4ur04O+XUMXixid8+4xceEajFSZd7IKB19CEwUkO3hjWXNQ==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=8.17.0" }, @@ -240,11 +235,10 @@ } }, "node_modules/@blockly/theme-tritanopia": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/@blockly/theme-tritanopia/-/theme-tritanopia-6.0.3.tgz", - "integrity": "sha512-U4Y7WB2jzFQbNtt7D74gixfPHFBK0FW5CqGCFFOO+mHz2AfKHA+s/cZiVblYomhlA1938mvjzIxbdnafzmaCiw==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@blockly/theme-tritanopia/-/theme-tritanopia-6.0.4.tgz", + "integrity": "sha512-7bHo8tZcjL3xP7FM23R7kxJSN2K8kwn5KA0jx2GQ5gMbd+woHRo0VBXV/HeH5d6ulFTPUNoCb9XjuTVLRiW6zQ==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=8.17.0" }, diff --git a/package.json b/package.json index e81bfb875..74e3227e5 100644 --- a/package.json +++ b/package.json @@ -101,7 +101,7 @@ "license": "Apache-2.0", "devDependencies": { "@blockly/block-test": "^6.0.4", - "@blockly/dev-tools": "^8.0.4", + "@blockly/dev-tools": "^8.0.6", "@blockly/theme-modern": "^6.0.3", "@hyperjump/browser": "^1.1.4", "@hyperjump/json-schema": "^1.5.0", diff --git a/tests/browser/test/toolbox_drag_test.mjs b/tests/browser/test/toolbox_drag_test.mjs index ab0fa828f..c751f5552 100644 --- a/tests/browser/test/toolbox_drag_test.mjs +++ b/tests/browser/test/toolbox_drag_test.mjs @@ -25,7 +25,6 @@ const basicCategories = [ 'Math', 'Text', 'Lists', - 'Colour', 'Variables', 'Functions', ]; @@ -44,7 +43,6 @@ const testCategories = [ // 'Fields', 'Defaults', 'Numbers', - 'Angles', 'Drop-downs', // Note: images has a block that has a bad image source, but still builds and renders // just fine. From 23e901120b55ac198389eef7740c52aced174642 Mon Sep 17 00:00:00 2001 From: Jeremiah Saunders <46662314+UCYT5040@users.noreply.github.com> Date: Wed, 7 Aug 2024 11:07:48 -0500 Subject: [PATCH 17/90] feat: expose `bringToFront()` method (#8472) * Remove internal from bringToFront JSDoc * Add a note about the cost of this method * Remove unnecessary colon --- core/block_svg.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/block_svg.ts b/core/block_svg.ts index 1a96d166a..14c580574 100644 --- a/core/block_svg.ts +++ b/core/block_svg.ts @@ -1171,10 +1171,11 @@ export class BlockSvg * tags do not respect z-index so SVG renders them in the * order that they are in the DOM. By placing this block first within the * block group's , it will render on top of any other blocks. + * Use sparingly, this method is expensive because it reorders the DOM + * nodes. * - * @param blockOnly: True to only move this block to the front without + * @param blockOnly True to only move this block to the front without * adjusting its parents. - * @internal */ bringToFront(blockOnly = false) { /* eslint-disable-next-line @typescript-eslint/no-this-alias */ From cf5a3c0fa37da0b94994055b160e9ed6aa847f57 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 Aug 2024 09:37:37 -0700 Subject: [PATCH 18/90] chore(deps): bump @microsoft/api-documenter from 7.25.7 to 7.25.10 (#8464) Bumps [@microsoft/api-documenter](https://github.com/microsoft/rushstack/tree/HEAD/apps/api-documenter) from 7.25.7 to 7.25.10. - [Changelog](https://github.com/microsoft/rushstack/blob/main/apps/api-documenter/CHANGELOG.md) - [Commits](https://github.com/microsoft/rushstack/commits/@microsoft/api-documenter_v7.25.10/apps/api-documenter) --- updated-dependencies: - dependency-name: "@microsoft/api-documenter" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2b72eff83..93b1a3283 100644 --- a/package-lock.json +++ b/package-lock.json @@ -621,16 +621,16 @@ } }, "node_modules/@microsoft/api-documenter": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@microsoft/api-documenter/-/api-documenter-7.25.7.tgz", - "integrity": "sha512-jxGFnZ8olak7q/DVPpMYKb8xvMu9ySmvdx0ltLhkaXXCfD/md5ZlJjEOMNHTnP5I1HclJ1Z8WyRilL+GmycKmw==", + "version": "7.25.10", + "resolved": "https://registry.npmjs.org/@microsoft/api-documenter/-/api-documenter-7.25.10.tgz", + "integrity": "sha512-GYc5AALrP9gxYPpkPc/BXXdekg+Ge8p9yyO1aRVwJDGzCXR7XRUvh6gc2jay/DmBx4KfyMx0LFWJ0HcUXudqgQ==", "dev": true, "dependencies": { - "@microsoft/api-extractor-model": "7.29.3", + "@microsoft/api-extractor-model": "7.29.4", "@microsoft/tsdoc": "~0.15.0", - "@rushstack/node-core-library": "5.5.0", - "@rushstack/terminal": "0.13.2", - "@rushstack/ts-command-line": "4.22.2", + "@rushstack/node-core-library": "5.5.1", + "@rushstack/terminal": "0.13.3", + "@rushstack/ts-command-line": "4.22.4", "js-yaml": "~3.13.1", "resolve": "~1.22.1" }, @@ -639,20 +639,20 @@ } }, "node_modules/@microsoft/api-documenter/node_modules/@microsoft/api-extractor-model": { - "version": "7.29.3", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.29.3.tgz", - "integrity": "sha512-kEWjLr2ygL3ku9EGyjeTnL2S5IxyH9NaF1k1UoI0Nzwr4xEJBSWCVsWuF2+0lPUrRPA6mTY95fR264SJ5ETKQA==", + "version": "7.29.4", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.29.4.tgz", + "integrity": "sha512-LHOMxmT8/tU1IiiiHOdHFF83Qsi+V8d0kLfscG4EvQE9cafiR8blOYr8SfkQKWB1wgEilQgXJX3MIA4vetDLZw==", "dev": true, "dependencies": { "@microsoft/tsdoc": "~0.15.0", "@microsoft/tsdoc-config": "~0.17.0", - "@rushstack/node-core-library": "5.5.0" + "@rushstack/node-core-library": "5.5.1" } }, "node_modules/@microsoft/api-documenter/node_modules/@rushstack/node-core-library": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-5.5.0.tgz", - "integrity": "sha512-Cl3MYQ74Je5Y/EngMxcA3SpHjGZ/022nKbAO1aycGfQ+7eKyNCBu0oywj5B1f367GCzuHBgy+3BlVLKysHkXZw==", + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-5.5.1.tgz", + "integrity": "sha512-ZutW56qIzH8xIOlfyaLQJFx+8IBqdbVCZdnj+XT1MorQ1JqqxHse8vbCpEM+2MjsrqcbxcgDIbfggB1ZSQ2A3g==", "dev": true, "dependencies": { "ajv": "~8.13.0", @@ -674,12 +674,12 @@ } }, "node_modules/@microsoft/api-documenter/node_modules/@rushstack/terminal": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/@rushstack/terminal/-/terminal-0.13.2.tgz", - "integrity": "sha512-t8i0PsGvBHmFBY8pryO3badqFlxQsm2rw3KYrzjcmVkG/WGklKg1qVkr9beAS1Oe8XWDRgj6SkoHkpNjs7aaNw==", + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/@rushstack/terminal/-/terminal-0.13.3.tgz", + "integrity": "sha512-fc3zjXOw8E0pXS5t9vTiIPx9gHA0fIdTXsu9mT4WbH+P3mYvnrX0iAQ5a6NvyK1+CqYWBTw/wVNx7SDJkI+WYQ==", "dev": true, "dependencies": { - "@rushstack/node-core-library": "5.5.0", + "@rushstack/node-core-library": "5.5.1", "supports-color": "~8.1.1" }, "peerDependencies": { @@ -692,12 +692,12 @@ } }, "node_modules/@microsoft/api-documenter/node_modules/@rushstack/ts-command-line": { - "version": "4.22.2", - "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.22.2.tgz", - "integrity": "sha512-xkvrGd6D9dPlI3I401Thc640WNsEPB1sGEmy12a2VJaPQPwhE6Ik0gEVPZJ/2G1w213eaCAdxUY1xpiTulsmpA==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.22.4.tgz", + "integrity": "sha512-QoyhbWfyF9Ixg5DWdPzxO3h2RmJ7i5WH9b7qLzD5h5WFya/ZqicjdPrVwQiGtrFvAbBj8jhcC9DhbzU9xAk78g==", "dev": true, "dependencies": { - "@rushstack/terminal": "0.13.2", + "@rushstack/terminal": "0.13.3", "@types/argparse": "1.0.38", "argparse": "~1.0.9", "string-argv": "~0.3.1" From 6b3f9a672397c866e4b22056ba4bd1ae93726cbd Mon Sep 17 00:00:00 2001 From: AbhinavKRNarayan <115357208+AbhinavKRN@users.noreply.github.com> Date: Fri, 9 Aug 2024 03:47:34 +0530 Subject: [PATCH 19/90] fix(touch): prevent infinite loop on multi-touch drag (#8470) * Change in gesture.ts * prettier --- core/gesture.ts | 11 +++++++++-- package-lock.json | 3 ++- package.json | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/core/gesture.ts b/core/gesture.ts index 7970ed006..0aefba47d 100644 --- a/core/gesture.ts +++ b/core/gesture.ts @@ -599,13 +599,20 @@ export class Gesture { */ handleTouchMove(e: PointerEvent) { const pointerId = Touch.getTouchIdentifierFromEvent(e); - // Update the cache this.cachedPoints.set(pointerId, this.getTouchPoint(e)); if (this.isPinchZoomEnabled && this.cachedPoints.size === 2) { this.handlePinch(e); } else { - this.handleMove(e); + // Handle the move directly instead of calling handleMove + this.updateFromEvent(e); + if (this.workspaceDragger) { + this.workspaceDragger.drag(this.currentDragDeltaXY); + } else if (this.dragger) { + this.dragger.onDrag(this.mostRecentEvent, this.currentDragDeltaXY); + } + e.preventDefault(); + e.stopPropagation(); } } diff --git a/package-lock.json b/package-lock.json index 93b1a3283..0ef6d5021 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,7 +47,7 @@ "markdown-tables-to-json": "^0.1.7", "mocha": "^10.0.0", "patch-package": "^8.0.0", - "prettier": "3.3.3", + "prettier": "^3.3.3", "readline-sync": "^1.4.10", "rimraf": "^5.0.0", "typescript": "^5.3.3", @@ -9600,6 +9600,7 @@ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", "dev": true, + "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" }, diff --git a/package.json b/package.json index 74e3227e5..4df66d662 100644 --- a/package.json +++ b/package.json @@ -134,7 +134,7 @@ "markdown-tables-to-json": "^0.1.7", "mocha": "^10.0.0", "patch-package": "^8.0.0", - "prettier": "3.3.3", + "prettier": "^3.3.3", "readline-sync": "^1.4.10", "rimraf": "^5.0.0", "typescript": "^5.3.3", From 8fa216c22660db5c9657a43a4e92998faab40b53 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Aug 2024 19:14:47 +0100 Subject: [PATCH 20/90] chore(deps): bump gulp from 4.0.2 to 5.0.0 (#8463) Bumps [gulp](https://github.com/gulpjs/gulp) from 4.0.2 to 5.0.0. - [Release notes](https://github.com/gulpjs/gulp/releases) - [Changelog](https://github.com/gulpjs/gulp/blob/master/CHANGELOG.md) - [Commits](https://github.com/gulpjs/gulp/compare/v4.0.2...v5.0.0) --- updated-dependencies: - dependency-name: gulp dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 3478 ++++++--------------------------------------- package.json | 2 +- 2 files changed, 431 insertions(+), 3049 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0ef6d5021..9d441b410 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,7 +31,7 @@ "eslint-plugin-jsdoc": "^48.0.2", "glob": "^10.3.4", "google-closure-compiler": "^20240317.0.0", - "gulp": "^4.0.2", + "gulp": "^5.0.0", "gulp-concat": "^2.6.1", "gulp-gzip": "^1.4.2", "gulp-header": "^2.0.9", @@ -416,6 +416,27 @@ "xtend": "~4.0.1" } }, + "node_modules/@gulpjs/messages": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@gulpjs/messages/-/messages-1.1.0.tgz", + "integrity": "sha512-Ys9sazDatyTgZVb4xPlDufLweJ/Os2uHWOv+Caxvy2O85JcnT4M3vc73bi8pdLWlv3fdWQz3pdI9tVwo8rQQSg==", + "dev": true, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/@gulpjs/to-absolute-glob": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@gulpjs/to-absolute-glob/-/to-absolute-glob-4.0.0.tgz", + "integrity": "sha512-kjotm7XJrJ6v+7knhPaRgaT6q8F8K2jiafwYdNHLzmV0uGLuZY43FK6smNSHUPrhq5kX2slCUy+RGG/xGqmIKA==", + "dev": true, + "dependencies": { + "is-negated-glob": "^1.0.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.14", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", @@ -2122,15 +2143,6 @@ "node": ">=0.10.0" } }, - "node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -2162,9 +2174,9 @@ "dev": true }, "node_modules/anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dev": true, "dependencies": { "normalize-path": "^3.0.0", @@ -2174,18 +2186,6 @@ "node": ">= 8" } }, - "node_modules/append-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/append-buffer/-/append-buffer-1.0.2.tgz", - "integrity": "sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE=", - "dev": true, - "dependencies": { - "buffer-equal": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/archiver": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/archiver/-/archiver-7.0.1.tgz", @@ -2369,12 +2369,6 @@ "safe-buffer": "~5.2.0" } }, - "node_modules/archy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", - "dev": true - }, "node_modules/are-docs-informative": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz", @@ -2408,39 +2402,6 @@ "node": ">=0.10.0" } }, - "node_modules/arr-filter": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/arr-filter/-/arr-filter-1.1.2.tgz", - "integrity": "sha1-Q/3d0JHo7xGqTEXZzcGOLf8XEe4=", - "dev": true, - "dependencies": { - "make-iterator": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/arr-map": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/arr-map/-/arr-map-2.0.2.tgz", - "integrity": "sha1-Onc0X/wc814qkYJWAfnljy4kysQ=", - "dev": true, - "dependencies": { - "make-iterator": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/arr-union": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", @@ -2453,50 +2414,7 @@ "node_modules/array-each": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", - "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/array-initial": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/array-initial/-/array-initial-1.1.0.tgz", - "integrity": "sha1-L6dLJnOTccOUe9enrcc74zSz15U=", - "dev": true, - "dependencies": { - "array-slice": "^1.0.0", - "is-number": "^4.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/array-initial/node_modules/is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/array-last": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/array-last/-/array-last-1.3.0.tgz", - "integrity": "sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg==", - "dev": true, - "dependencies": { - "is-number": "^4.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/array-last/node_modules/is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "integrity": "sha512-zHjL5SZa68hkKHBFBK6DJCTtr9sfTCPCaph/L7tMSLcTFgy+zX7E+6q5UArbtOtMBCtxdICpfTCspRse+ywyXA==", "dev": true, "engines": { "node": ">=0.10.0" @@ -2511,20 +2429,6 @@ "node": ">=0.10.0" } }, - "node_modules/array-sort": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-sort/-/array-sort-1.0.0.tgz", - "integrity": "sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg==", - "dev": true, - "dependencies": { - "default-compare": "^1.0.0", - "get-value": "^2.0.6", - "kind-of": "^5.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/array-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", @@ -2534,15 +2438,6 @@ "node": ">=8" } }, - "node_modules/array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/assertion-error": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", @@ -2599,37 +2494,16 @@ "node": ">= 10.13.0" } }, - "node_modules/async-each": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", - "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", - "dev": true - }, "node_modules/async-settle": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async-settle/-/async-settle-1.0.0.tgz", - "integrity": "sha1-HQqRS7Aldb7IqPOnTlCA9yssDGs=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/async-settle/-/async-settle-2.0.0.tgz", + "integrity": "sha512-Obu/KE8FurfQRN6ODdHN9LuXqwC+JFIM9NRyZqJJ4ZfLJmIYN9Rg0/kb+wF70VV5+fJusTMQlJ1t5rF7J/ETdg==", "dev": true, "dependencies": { - "async-done": "^1.2.2" + "async-done": "^2.0.0" }, "engines": { - "node": ">= 0.10" - } - }, - "node_modules/async-settle/node_modules/async-done": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/async-done/-/async-done-1.3.2.tgz", - "integrity": "sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==", - "dev": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.2", - "process-nextick-args": "^2.0.0", - "stream-exhaust": "^1.0.1" - }, - "engines": { - "node": ">= 0.10" + "node": ">= 10.13.0" } }, "node_modules/asynckit": { @@ -2665,38 +2539,17 @@ "dev": true }, "node_modules/bach": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/bach/-/bach-1.2.0.tgz", - "integrity": "sha1-Szzpa/JxNPeaG0FKUcFONMO9mIA=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bach/-/bach-2.0.1.tgz", + "integrity": "sha512-A7bvGMGiTOxGMpNupYl9HQTf0FFDNF4VCmks4PJpFyN1AX2pdKuxuwdvUz2Hu388wcgp+OvGFNsumBfFNkR7eg==", "dev": true, "dependencies": { - "arr-filter": "^1.1.1", - "arr-flatten": "^1.0.1", - "arr-map": "^2.0.0", - "array-each": "^1.0.0", - "array-initial": "^1.0.0", - "array-last": "^1.1.1", - "async-done": "^1.2.2", - "async-settle": "^1.0.0", - "now-and-later": "^2.0.0" + "async-done": "^2.0.0", + "async-settle": "^2.0.0", + "now-and-later": "^3.0.0" }, "engines": { - "node": ">= 0.10" - } - }, - "node_modules/bach/node_modules/async-done": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/async-done/-/async-done-1.3.2.tgz", - "integrity": "sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==", - "dev": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.2", - "process-nextick-args": "^2.0.0", - "stream-exhaust": "^1.0.1" - }, - "engines": { - "node": ">= 0.10" + "node": ">=10.13.0" } }, "node_modules/balanced-match": { @@ -2751,36 +2604,6 @@ "streamx": "^2.18.0" } }, - "node_modules/base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "dependencies": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/base/node_modules/define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "dependencies": { - "is-descriptor": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -2843,6 +2666,41 @@ "url": "https://bevry.me/fund" } }, + "node_modules/bl": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", + "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", + "dev": true, + "dependencies": { + "buffer": "^6.0.3", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/bl/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -2854,12 +2712,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -2904,15 +2762,6 @@ "node": "*" } }, - "node_modules/buffer-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz", - "integrity": "sha1-WWFrSYME1Var1GaWayLu2j7KX74=", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -2928,26 +2777,6 @@ "node": ">= 0.8" } }, - "node_modules/cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, - "dependencies": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/cacheable-lookup": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", @@ -2987,19 +2816,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -3104,95 +2920,6 @@ "node": ">=8" } }, - "node_modules/class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "dev": true, - "dependencies": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/class-utils/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/class-utils/node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/class-utils/node_modules/is-accessor-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/class-utils/node_modules/is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/class-utils/node_modules/is-data-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/class-utils/node_modules/is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -3254,42 +2981,6 @@ "util-deprecate": "~1.0.1" } }, - "node_modules/code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/collection-map": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-map/-/collection-map-1.0.0.tgz", - "integrity": "sha1-rqDwb40mx4DCt1SUOFVEsiVa8Yw=", - "dev": true, - "dependencies": { - "arr-map": "^2.0.2", - "for-own": "^1.0.0", - "make-iterator": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "dev": true, - "dependencies": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -3346,12 +3037,6 @@ "node": ">= 12.0.0" } }, - "node_modules/component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", - "dev": true - }, "node_modules/compress-commons": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-6.0.2.tgz", @@ -3551,23 +3236,17 @@ "safe-buffer": "~5.1.1" } }, - "node_modules/copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/copy-props": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/copy-props/-/copy-props-2.0.5.tgz", - "integrity": "sha512-XBlx8HSqrT0ObQwmSzM7WE5k8FxTV75h1DX1Z3n6NhQ/UYYAvInWYmG06vFt7hQZArE2fuO62aihiWIVQwh1sw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/copy-props/-/copy-props-4.0.0.tgz", + "integrity": "sha512-bVWtw1wQLzzKiYROtvNlbJgxgBYt2bMJpkCbKmXM3xyijvcjjWXEk5nyrrT3bgJ7ODb19ZohE2T0Y3FgNPyoTw==", "dev": true, "dependencies": { - "each-props": "^1.3.2", + "each-props": "^3.0.0", "is-plain-object": "^5.0.0" + }, + "engines": { + "node": ">= 10.13.0" } }, "node_modules/core-util-is": { @@ -3846,15 +3525,6 @@ "ms": "^2.1.1" } }, - "node_modules/decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/decimal.js": { "version": "10.4.3", "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", @@ -3920,27 +3590,6 @@ "node": ">=16.0.0" } }, - "node_modules/default-compare": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/default-compare/-/default-compare-1.0.0.tgz", - "integrity": "sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ==", - "dev": true, - "dependencies": { - "kind-of": "^5.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/default-resolution": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/default-resolution/-/default-resolution-2.0.0.tgz", - "integrity": "sha1-vLgrqnKtebQmp2cy8aga1t8m1oQ=", - "dev": true, - "engines": { - "node": ">= 0.10" - } - }, "node_modules/defer-to-connect": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", @@ -3950,31 +3599,6 @@ "node": ">=10" } }, - "node_modules/define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "dev": true, - "dependencies": { - "object-keys": "^1.0.12" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "dev": true, - "dependencies": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/degenerator": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-5.0.1.tgz", @@ -4000,7 +3624,7 @@ "node_modules/detect-file": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", - "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", + "integrity": "sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q==", "dev": true, "engines": { "node": ">=0.10.0" @@ -4063,53 +3687,17 @@ "node": ">=6.0.0" } }, - "node_modules/duplexify": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", - "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", - "dev": true, - "dependencies": { - "end-of-stream": "^1.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.0.0", - "stream-shift": "^1.0.0" - } - }, - "node_modules/duplexify/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, "node_modules/each-props": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/each-props/-/each-props-1.3.2.tgz", - "integrity": "sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/each-props/-/each-props-3.0.0.tgz", + "integrity": "sha512-IYf1hpuWrdzse/s/YJOrFmU15lyhSzxelNVAHTEG3DtP4QsLTWZUzcUL3HMXmKQxXpa4EIrBPpwRgj0aehdvAw==", "dev": true, "dependencies": { - "is-plain-object": "^2.0.1", + "is-plain-object": "^5.0.0", "object.defaults": "^1.1.0" - } - }, - "node_modules/each-props/node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "dependencies": { - "isobject": "^3.0.1" }, "engines": { - "node": ">=0.10.0" + "node": ">= 10.13.0" } }, "node_modules/eastasianwidth": { @@ -4241,15 +3829,6 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, - "node_modules/error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "dependencies": { - "is-arrayish": "^0.2.1" - } - }, "node_modules/es-module-lexer": { "version": "1.5.4", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz", @@ -4623,138 +4202,10 @@ "node": ">=0.8.x" } }, - "node_modules/expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "dependencies": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/expand-brackets/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/expand-brackets/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/expand-brackets/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/expand-brackets/node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/expand-brackets/node_modules/is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/expand-brackets/node_modules/is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/expand-brackets/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/expand-brackets/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, "node_modules/expand-tilde": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", - "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "integrity": "sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==", "dev": true, "dependencies": { "homedir-polyfill": "^1.0.1" @@ -4797,58 +4248,6 @@ "node": ">=0.10.0" } }, - "node_modules/extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "dependencies": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/extglob/node_modules/define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "dependencies": { - "is-descriptor": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/extglob/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/extglob/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/extract-zip": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", @@ -4912,19 +4311,6 @@ "node": ">=8.6.0" } }, - "node_modules/fast-glob/node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -4937,6 +4323,15 @@ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, + "node_modules/fastest-levenshtein": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", + "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", + "dev": true, + "engines": { + "node": ">= 4.9.1" + } + }, "node_modules/fastq": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", @@ -4991,9 +4386,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -5027,69 +4422,44 @@ "micromatch": "^4.0.2" } }, - "node_modules/find-yarn-workspace-root/node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, "node_modules/findup-sync": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", - "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-5.0.0.tgz", + "integrity": "sha512-MzwXju70AuyflbgeOhzvQWAvvQdo1XL0A9bVvlXsYcFEBM87WR4OakL4OfZq+QRmr+duJubio+UtNQCPsVESzQ==", "dev": true, "dependencies": { "detect-file": "^1.0.0", - "is-glob": "^4.0.0", - "micromatch": "^3.0.4", + "is-glob": "^4.0.3", + "micromatch": "^4.0.4", "resolve-dir": "^1.0.1" }, "engines": { - "node": ">= 0.10" + "node": ">= 10.13.0" } }, "node_modules/fined": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz", - "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fined/-/fined-2.0.0.tgz", + "integrity": "sha512-OFRzsL6ZMHz5s0JrsEr+TpdGNCtrVtnuG3x1yzGNiQHT0yaDnXAj8V/lWcpJVrnoDpcwXcASxAZYbuXda2Y82A==", "dev": true, "dependencies": { "expand-tilde": "^2.0.2", - "is-plain-object": "^2.0.3", + "is-plain-object": "^5.0.0", "object.defaults": "^1.1.0", - "object.pick": "^1.2.0", - "parse-filepath": "^1.0.1" + "object.pick": "^1.3.0", + "parse-filepath": "^1.0.2" }, "engines": { - "node": ">= 0.10" - } - }, - "node_modules/fined/node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" + "node": ">= 10.13.0" } }, "node_modules/flagged-respawn": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz", - "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-2.0.0.tgz", + "integrity": "sha512-Gq/a6YCi8zexmGHMuJwahTGzXlAZAOsbCVKduWXC6TlLCjjFRlExMJc4GC2NYPYZ0r/brw9P7CpRgQmlPVeOoA==", "dev": true, "engines": { - "node": ">= 0.10" + "node": ">= 10.13.0" } }, "node_modules/flat": { @@ -5155,31 +4525,6 @@ "integrity": "sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==", "dev": true }, - "node_modules/flush-write-stream": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", - "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "readable-stream": "^2.3.6" - } - }, - "node_modules/flush-write-stream/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, "node_modules/follow-redirects": { "version": "1.15.4", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz", @@ -5203,7 +4548,7 @@ "node_modules/for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "integrity": "sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==", "dev": true, "engines": { "node": ">=0.10.0" @@ -5212,7 +4557,7 @@ "node_modules/for-own": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", - "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", + "integrity": "sha512-0OABksIGrxKK8K4kynWkQ7y1zounQxP+CWnyclVwj81KW3vlLlGUx57DKGcP/LH216GzqnstnPocF16Nxs0Ycg==", "dev": true, "dependencies": { "for-in": "^1.0.1" @@ -5271,18 +4616,6 @@ "node": ">=12.20.0" } }, - "node_modules/fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "dependencies": { - "map-cache": "^0.2.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/fs-extra": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", @@ -5316,41 +4649,16 @@ } }, "node_modules/fs-mkdirp-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz", - "integrity": "sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-2.0.1.tgz", + "integrity": "sha512-UTOY+59K6IA94tec8Wjqm0FSh5OVudGNB0NL/P6fB3HiE3bYOY3VYBGijsnOHNkQSwC1FKkU77pmq7xp9CskLw==", "dev": true, "dependencies": { - "graceful-fs": "^4.1.11", - "through2": "^2.0.3" + "graceful-fs": "^4.2.8", + "streamx": "^2.12.0" }, "engines": { - "node": ">= 0.10" - } - }, - "node_modules/fs-mkdirp-stream/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/fs-mkdirp-stream/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" + "node": ">=10.13.0" } }, "node_modules/fs.realpath": { @@ -5486,20 +4794,6 @@ "node": "*" } }, - "node_modules/get-intrinsic": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/get-port": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/get-port/-/get-port-7.1.0.tgz", @@ -5574,15 +4868,6 @@ "node": ">= 4.0.0" } }, - "node_modules/get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/glob": { "version": "10.4.1", "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.1.tgz", @@ -5618,301 +4903,47 @@ } }, "node_modules/glob-stream": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz", - "integrity": "sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ=", + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-8.0.2.tgz", + "integrity": "sha512-R8z6eTB55t3QeZMmU1C+Gv+t5UnNRkA55c5yo67fAVfxODxieTwsjNG7utxS/73NdP1NbDgCrhVEg2h00y4fFw==", "dev": true, "dependencies": { - "extend": "^3.0.0", - "glob": "^7.1.1", - "glob-parent": "^3.1.0", + "@gulpjs/to-absolute-glob": "^4.0.0", + "anymatch": "^3.1.3", + "fastq": "^1.13.0", + "glob-parent": "^6.0.2", + "is-glob": "^4.0.3", "is-negated-glob": "^1.0.0", - "ordered-read-streams": "^1.0.0", - "pumpify": "^1.3.5", - "readable-stream": "^2.1.5", - "remove-trailing-separator": "^1.0.1", - "to-absolute-glob": "^2.0.0", - "unique-stream": "^2.0.2" + "normalize-path": "^3.0.0", + "streamx": "^2.12.5" }, "engines": { - "node": ">= 0.10" - } - }, - "node_modules/glob-stream/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">=10.13.0" } }, "node_modules/glob-stream/node_modules/glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, "dependencies": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - } - }, - "node_modules/glob-stream/node_modules/is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.0" + "is-glob": "^4.0.3" }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/glob-stream/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "node": ">=10.13.0" } }, "node_modules/glob-watcher": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-5.0.5.tgz", - "integrity": "sha512-zOZgGGEHPklZNjZQaZ9f41i7F2YwE+tS5ZHrDhbBCk3stwahn5vQxnFmBJZHoYdusR6R1bLSXeGUy/BhctwKzw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-6.0.0.tgz", + "integrity": "sha512-wGM28Ehmcnk2NqRORXFOTOR064L4imSw3EeOqU5bIwUf62eXGwg89WivH6VMahL8zlQHeodzvHpXplrqzrz3Nw==", "dev": true, "dependencies": { - "anymatch": "^2.0.0", - "async-done": "^1.2.0", - "chokidar": "^2.0.0", - "is-negated-glob": "^1.0.0", - "just-debounce": "^1.0.0", - "normalize-path": "^3.0.0", - "object.defaults": "^1.1.0" + "async-done": "^2.0.0", + "chokidar": "^3.5.3" }, "engines": { - "node": ">= 0.10" - } - }, - "node_modules/glob-watcher/node_modules/anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "dev": true, - "dependencies": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - } - }, - "node_modules/glob-watcher/node_modules/anymatch/node_modules/normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "dependencies": { - "remove-trailing-separator": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/glob-watcher/node_modules/async-done": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/async-done/-/async-done-1.3.2.tgz", - "integrity": "sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==", - "dev": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.2", - "process-nextick-args": "^2.0.0", - "stream-exhaust": "^1.0.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/glob-watcher/node_modules/binary-extensions": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", - "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/glob-watcher/node_modules/braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "dependencies": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/glob-watcher/node_modules/chokidar": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", - "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", - "deprecated": "Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.", - "dev": true, - "dependencies": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "glob-parent": "^3.1.0", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.1" - }, - "optionalDependencies": { - "fsevents": "^1.2.7" - } - }, - "node_modules/glob-watcher/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/glob-watcher/node_modules/fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "dependencies": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/glob-watcher/node_modules/glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "dependencies": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - } - }, - "node_modules/glob-watcher/node_modules/glob-parent/node_modules/is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/glob-watcher/node_modules/is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "dev": true, - "dependencies": { - "binary-extensions": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/glob-watcher/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/glob-watcher/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/glob-watcher/node_modules/readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/glob-watcher/node_modules/to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "dependencies": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - }, - "engines": { - "node": ">=0.10.0" + "node": ">= 10.13.0" } }, "node_modules/glob/node_modules/brace-expansion": { @@ -5956,7 +4987,7 @@ "node_modules/global-prefix": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", - "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", + "integrity": "sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==", "dev": true, "dependencies": { "expand-tilde": "^2.0.2", @@ -6029,15 +5060,15 @@ } }, "node_modules/glogg": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.2.tgz", - "integrity": "sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/glogg/-/glogg-2.2.0.tgz", + "integrity": "sha512-eWv1ds/zAlz+M1ioHsyKJomfY7jbDDPpwSkv14KQj89bycx1nvK5/2Cj/T9g7kzJcX5Bc7Yv22FjfBZS/jl94A==", "dev": true, "dependencies": { - "sparkles": "^1.0.0" + "sparkles": "^2.1.0" }, "engines": { - "node": ">= 0.10" + "node": ">= 10.13.0" } }, "node_modules/google-closure-compiler": { @@ -6151,9 +5182,9 @@ } }, "node_modules/graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, "node_modules/grapheme-splitter": { @@ -6169,258 +5200,74 @@ "dev": true }, "node_modules/gulp": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/gulp/-/gulp-4.0.2.tgz", - "integrity": "sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/gulp/-/gulp-5.0.0.tgz", + "integrity": "sha512-S8Z8066SSileaYw1S2N1I64IUc/myI2bqe2ihOBzO6+nKpvNSg7ZcWJt/AwF8LC/NVN+/QZ560Cb/5OPsyhkhg==", "dev": true, "dependencies": { - "glob-watcher": "^5.0.3", - "gulp-cli": "^2.2.0", - "undertaker": "^1.2.1", - "vinyl-fs": "^3.0.0" + "glob-watcher": "^6.0.0", + "gulp-cli": "^3.0.0", + "undertaker": "^2.0.0", + "vinyl-fs": "^4.0.0" }, "bin": { "gulp": "bin/gulp.js" }, "engines": { - "node": ">= 0.10" + "node": ">=10.13.0" } }, "node_modules/gulp-cli": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/gulp-cli/-/gulp-cli-2.3.0.tgz", - "integrity": "sha512-zzGBl5fHo0EKSXsHzjspp3y5CONegCm8ErO5Qh0UzFzk2y4tMvzLWhoDokADbarfZRL2pGpRp7yt6gfJX4ph7A==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/gulp-cli/-/gulp-cli-3.0.0.tgz", + "integrity": "sha512-RtMIitkT8DEMZZygHK2vEuLPqLPAFB4sntSxg4NoDta7ciwGZ18l7JuhCTiS5deOJi2IoK0btE+hs6R4sfj7AA==", "dev": true, "dependencies": { - "ansi-colors": "^1.0.1", - "archy": "^1.0.0", - "array-sort": "^1.0.0", - "color-support": "^1.1.3", - "concat-stream": "^1.6.0", - "copy-props": "^2.0.1", - "fancy-log": "^1.3.2", - "gulplog": "^1.0.0", - "interpret": "^1.4.0", - "isobject": "^3.0.1", - "liftoff": "^3.1.0", - "matchdep": "^2.0.0", - "mute-stdout": "^1.0.0", - "pretty-hrtime": "^1.0.0", - "replace-homedir": "^1.0.0", - "semver-greatest-satisfied-range": "^1.1.0", - "v8flags": "^3.2.0", - "yargs": "^7.1.0" + "@gulpjs/messages": "^1.1.0", + "chalk": "^4.1.2", + "copy-props": "^4.0.0", + "gulplog": "^2.2.0", + "interpret": "^3.1.1", + "liftoff": "^5.0.0", + "mute-stdout": "^2.0.0", + "replace-homedir": "^2.0.0", + "semver-greatest-satisfied-range": "^2.0.0", + "string-width": "^4.2.3", + "v8flags": "^4.0.0", + "yargs": "^16.2.0" }, "bin": { "gulp": "bin/gulp.js" }, "engines": { - "node": ">= 0.10" + "node": ">=10.13.0" } }, - "node_modules/gulp-cli/node_modules/ansi-colors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz", - "integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==", - "dev": true, - "dependencies": { - "ansi-wrap": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/gulp-cli/node_modules/camelcase": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/gulp-cli/node_modules/cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", - "dev": true, - "dependencies": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wrap-ansi": "^2.0.0" - } - }, - "node_modules/gulp-cli/node_modules/find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "dev": true, - "dependencies": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/gulp-cli/node_modules/get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", - "dev": true - }, - "node_modules/gulp-cli/node_modules/hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "dev": true - }, - "node_modules/gulp-cli/node_modules/is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "dependencies": { - "number-is-nan": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/gulp-cli/node_modules/normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "dependencies": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "node_modules/gulp-cli/node_modules/path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "dev": true, - "dependencies": { - "pinkie-promise": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/gulp-cli/node_modules/read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "dev": true, - "dependencies": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/gulp-cli/node_modules/read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "dev": true, - "dependencies": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/gulp-cli/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/gulp-cli/node_modules/string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "dependencies": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/gulp-cli/node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/gulp-cli/node_modules/wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "dev": true, - "dependencies": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/gulp-cli/node_modules/y18n": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz", - "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==", - "dev": true - }, "node_modules/gulp-cli/node_modules/yargs": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.2.tgz", - "integrity": "sha512-ZEjj/dQYQy0Zx0lgLMLR8QuaqTihnxirir7EwUHp1Axq4e3+k8jXU5K0VLbNvedv1f4EWtBonDIZm0NUr+jCcA==", + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, "dependencies": { - "camelcase": "^3.0.0", - "cliui": "^3.2.0", - "decamelize": "^1.1.1", - "get-caller-file": "^1.0.1", - "os-locale": "^1.4.0", - "read-pkg-up": "^1.0.1", + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^1.0.2", - "which-module": "^1.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^5.0.1" + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" } }, "node_modules/gulp-cli/node_modules/yargs-parser": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.1.tgz", - "integrity": "sha512-wpav5XYiddjXxirPoCTUPbqM0PXvJ9hiBMvuJgInvo4/lAOTZzUprArw17q2O1P2+GHhbBr18/iQwjL5Z9BqfA==", + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", "dev": true, - "dependencies": { - "camelcase": "^3.0.0", - "object.assign": "^4.1.0" + "engines": { + "node": ">=10" } }, "node_modules/gulp-concat": { @@ -6763,27 +5610,15 @@ } }, "node_modules/gulplog": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", - "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-2.2.0.tgz", + "integrity": "sha512-V2FaKiOhpR3DRXZuYdRLn/qiY0yI5XmqbTKrYbdemJ+xOh2d2MOweI/XFgMzd/9+1twdvMwllnZbWZNJ+BOm4A==", "dev": true, "dependencies": { - "glogg": "^1.0.0" + "glogg": "^2.2.0" }, "engines": { - "node": ">= 0.10" - } - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" + "node": ">= 10.13.0" } }, "node_modules/has-flag": { @@ -6795,57 +5630,6 @@ "node": ">=8" } }, - "node_modules/has-symbols": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", - "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "dev": true, - "dependencies": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "dev": true, - "dependencies": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/has-values/node_modules/kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/hasown": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", @@ -7088,21 +5872,12 @@ "dev": true }, "node_modules/interpret": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", - "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz", + "integrity": "sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==", "dev": true, "engines": { - "node": ">= 0.10" - } - }, - "node_modules/invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", - "dev": true, - "engines": { - "node": ">=0.10.0" + "node": ">=10.13.0" } }, "node_modules/ip": { @@ -7124,33 +5899,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-accessor-descriptor/node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -7163,12 +5911,6 @@ "node": ">=8" } }, - "node_modules/is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, "node_modules/is-core-module": { "version": "2.13.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", @@ -7181,50 +5923,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-data-descriptor/node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-descriptor/node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-docker": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", @@ -7297,34 +5995,19 @@ "node_modules/is-negated-glob": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", - "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", + "integrity": "sha512-czXVVn/QEmgvej1f50BZ648vUI+em0xqMq2Sn+QncCLN4zj1UAxlT+kw/6ggQTOaZPd1HqKQGEqbpQVtJucWug==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" + "node": ">=0.12.0" } }, "node_modules/is-path-inside": { @@ -7404,16 +6087,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", - "dev": true - }, "node_modules/is-valid-glob": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz", - "integrity": "sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao=", + "integrity": "sha512-AhiROmoEFDSsjx8hW+5sGwgKVIORcXnrlAx/R0ZSeaPw70Vw0CqkGBBhHGL58Uox2eXnU1AnvXJl1XlyedO5bA==", "dev": true, "engines": { "node": ">=0.10.0" @@ -7752,12 +6429,6 @@ "integrity": "sha512-silMIRiFjUWlfaDhkgSzpuAyQ6EX/o09Eu8ZBfmFwQMbax7+LQzeIU2CBrICT6Ne4l86ITCGvUCBpCubWYy0Yw==", "dev": true }, - "node_modules/just-debounce": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/just-debounce/-/just-debounce-1.1.0.tgz", - "integrity": "sha512-qpcRocdkUmf+UTNBYx5w6dexX5J31AKK1OmPwH630a83DdVVUIngk55RSAiIGpQyoH0dlr872VHfPjnQnK1qDQ==", - "dev": true - }, "node_modules/just-extend": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", @@ -7773,15 +6444,6 @@ "json-buffer": "3.0.1" } }, - "node_modules/kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/klaw-sync": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", @@ -7804,16 +6466,12 @@ } }, "node_modules/last-run": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/last-run/-/last-run-1.1.1.tgz", - "integrity": "sha1-RblpQsF7HHnHchmCWbqUO+v4yls=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/last-run/-/last-run-2.0.0.tgz", + "integrity": "sha512-j+y6WhTLN4Itnf9j5ZQos1BGPCS8DAwmgMroR3OzfxAsBxam0hMw7J8M3KqZl0pLQJ1jNnwIexg5DYpC/ctwEQ==", "dev": true, - "dependencies": { - "default-resolution": "^2.0.0", - "es6-weak-map": "^2.0.1" - }, "engines": { - "node": ">= 0.10" + "node": ">= 10.13.0" } }, "node_modules/lazystream": { @@ -7843,28 +6501,13 @@ "util-deprecate": "~1.0.1" } }, - "node_modules/lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "dev": true, - "dependencies": { - "invert-kv": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/lead": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lead/-/lead-1.0.0.tgz", - "integrity": "sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/lead/-/lead-4.0.0.tgz", + "integrity": "sha512-DpMa59o5uGUWWjruMp71e6knmwKU3jRBBn1kjuLWN9EeIOxNeSAwvHf03WIl8g/ZMR2oSQC9ej3yeLBwdDc/pg==", "dev": true, - "dependencies": { - "flush-write-stream": "^1.0.2" - }, "engines": { - "node": ">= 0.10" + "node": ">=10.13.0" } }, "node_modules/levn": { @@ -7890,62 +6533,21 @@ } }, "node_modules/liftoff": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-3.1.0.tgz", - "integrity": "sha512-DlIPlJUkCV0Ips2zf2pJP0unEoT1kwYhiiPUGF3s/jtxTCjziNLoiVVh+jqWOWeFi6mmwQ5fNxvAUyPad4Dfog==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-5.0.0.tgz", + "integrity": "sha512-a5BQjbCHnB+cy+gsro8lXJ4kZluzOijzJ1UVVfyJYZC+IP2pLv1h4+aysQeKuTmyO8NAqfyQAk4HWaP/HjcKTg==", "dev": true, "dependencies": { - "extend": "^3.0.0", - "findup-sync": "^3.0.0", - "fined": "^1.0.1", - "flagged-respawn": "^1.0.0", - "is-plain-object": "^2.0.4", - "object.map": "^1.0.0", - "rechoir": "^0.6.2", - "resolve": "^1.1.7" + "extend": "^3.0.2", + "findup-sync": "^5.0.0", + "fined": "^2.0.0", + "flagged-respawn": "^2.0.0", + "is-plain-object": "^5.0.0", + "rechoir": "^0.8.0", + "resolve": "^1.20.0" }, "engines": { - "node": ">= 0.8" - } - }, - "node_modules/liftoff/node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/load-json-file/node_modules/parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "dev": true, - "dependencies": { - "error-ex": "^1.2.0" - }, - "engines": { - "node": ">=0.10.0" + "node": ">=10.13.0" } }, "node_modules/locate-app": { @@ -8122,31 +6724,10 @@ "es5-ext": "~0.10.2" } }, - "node_modules/make-iterator": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", - "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/make-iterator/node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/map-cache": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "integrity": "sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==", "dev": true, "engines": { "node": ">=0.10.0" @@ -8158,18 +6739,6 @@ "integrity": "sha1-ih8HiW2CsQkmvTdEokIACfiJdKg=", "dev": true }, - "node_modules/map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "dev": true, - "dependencies": { - "object-visit": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/markdown-tables-to-json": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/markdown-tables-to-json/-/markdown-tables-to-json-0.1.7.tgz", @@ -8179,48 +6748,6 @@ "@ts-stack/markdown": "^1.3.0" } }, - "node_modules/matchdep": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/matchdep/-/matchdep-2.0.0.tgz", - "integrity": "sha1-xvNINKDY28OzfCfui7yyfHd1WC4=", - "dev": true, - "dependencies": { - "findup-sync": "^2.0.0", - "micromatch": "^3.0.4", - "resolve": "^1.4.0", - "stack-trace": "0.0.10" - }, - "engines": { - "node": ">= 0.10.0" - } - }, - "node_modules/matchdep/node_modules/findup-sync": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", - "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", - "dev": true, - "dependencies": { - "detect-file": "^1.0.0", - "is-glob": "^3.1.0", - "micromatch": "^3.0.4", - "resolve-dir": "^1.0.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/matchdep/node_modules/is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/memoizee": { "version": "0.4.15", "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.15.tgz", @@ -8253,118 +6780,16 @@ } }, "node_modules/micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", + "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", "dev": true, "dependencies": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" + "braces": "^3.0.3", + "picomatch": "^2.3.1" }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/micromatch/node_modules/braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "dependencies": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/micromatch/node_modules/braces/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/micromatch/node_modules/fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "dependencies": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/micromatch/node_modules/fill-range/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/micromatch/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/micromatch/node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/micromatch/node_modules/to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "dependencies": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - }, - "engines": { - "node": ">=0.10.0" + "node": ">=8.6" } }, "node_modules/mime": { @@ -8443,19 +6868,6 @@ "integrity": "sha512-7dX2/10ITVyqh4aOSVI9gdape+t9l2/8QxHrFmUXu4EEUpdlxl6RudZUPZoc+zuY2hk1j7XxVroIVIan/pD/SQ==", "dev": true }, - "node_modules/mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", - "dev": true, - "dependencies": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/mkdirp": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", @@ -8633,43 +7045,12 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/mute-stdout": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mute-stdout/-/mute-stdout-1.0.1.tgz", - "integrity": "sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mute-stdout/-/mute-stdout-2.0.0.tgz", + "integrity": "sha512-32GSKM3Wyc8dg/p39lWPKYu8zci9mJFzV1Np9Of0ZEpe6Fhssn/FbI7ywAMd40uX+p3ZKh3T5EeCFv81qS3HmQ==", "dev": true, "engines": { - "node": ">= 0.10" - } - }, - "node_modules/nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "dev": true, - "dependencies": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/nanomatch/node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "engines": { - "node": ">=0.10.0" + "node": ">= 10.13.0" } }, "node_modules/natural-compare": { @@ -8767,24 +7148,15 @@ } }, "node_modules/now-and-later": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.1.tgz", - "integrity": "sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/now-and-later/-/now-and-later-3.0.0.tgz", + "integrity": "sha512-pGO4pzSdaxhWTGkfSfHx3hVzJVslFPwBp2Myq9MYN/ChfJZF87ochMAXnvz6/58RJSf5ik2q9tXprBBrk2cpcg==", "dev": true, "dependencies": { - "once": "^1.3.2" + "once": "^1.4.0" }, "engines": { - "node": ">= 0.10" - } - }, - "node_modules/number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true, - "engines": { - "node": ">=0.10.0" + "node": ">= 10.13.0" } }, "node_modules/nwsapi": { @@ -8801,134 +7173,10 @@ "node": ">=0.10.0" } }, - "node_modules/object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "dependencies": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy/node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy/node_modules/is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy/node_modules/is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy/node_modules/is-descriptor/node_modules/kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "dependencies": { - "isobject": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object.assign": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", - "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/object.defaults": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", - "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", + "integrity": "sha512-c/K0mw/F11k4dEUBMW8naXUuBuhxRCfG7W+yFy8EcijU/rSmazOUd1XAEEe6bC0OuXY4HUKjTJv7xbxIMqdxrA==", "dev": true, "dependencies": { "array-each": "^1.0.1", @@ -8940,23 +7188,10 @@ "node": ">=0.10.0" } }, - "node_modules/object.map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", - "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=", - "dev": true, - "dependencies": { - "for-own": "^1.0.0", - "make-iterator": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/object.pick": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "integrity": "sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ==", "dev": true, "dependencies": { "isobject": "^3.0.1" @@ -8965,19 +7200,6 @@ "node": ">=0.10.0" } }, - "node_modules/object.reduce": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object.reduce/-/object.reduce-1.0.1.tgz", - "integrity": "sha1-b+NI8qx/oPlcpiEiZZkJaCW7A60=", - "dev": true, - "dependencies": { - "for-own": "^1.0.0", - "make-iterator": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -9029,42 +7251,6 @@ "node": ">= 0.8.0" } }, - "node_modules/ordered-read-streams": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz", - "integrity": "sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4=", - "dev": true, - "dependencies": { - "readable-stream": "^2.0.1" - } - }, - "node_modules/ordered-read-streams/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/os-locale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", - "dev": true, - "dependencies": { - "lcid": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", @@ -9167,7 +7353,7 @@ "node_modules/parse-filepath": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", - "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=", + "integrity": "sha512-FwdRXKCohSVeXqwtYonZTXtbGJKrn+HNyWDYVcp5yuJlesTwNH4rsmRZ+GrKAPJ5bLpRxESMeS+Rl0VCHRvB2Q==", "dev": true, "dependencies": { "is-absolute": "^1.0.0", @@ -9203,7 +7389,7 @@ "node_modules/parse-passwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "integrity": "sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==", "dev": true, "engines": { "node": ">=0.10.0" @@ -9220,15 +7406,6 @@ "url": "https://github.com/inikulin/parse5?sponsor=1" } }, - "node_modules/pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/patch-package": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-8.0.0.tgz", @@ -9315,12 +7492,6 @@ "node": ">=6" } }, - "node_modules/path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", - "dev": true - }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -9357,7 +7528,7 @@ "node_modules/path-root": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", - "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", + "integrity": "sha512-QLcPegTHF11axjfojBIoDygmS2E3Lf+8+jI6wOVmNVenrKSo3mFdSGiIgdSHenczw3wPtlVMQaFVwGmM7BJdtg==", "dev": true, "dependencies": { "path-root-regex": "^0.1.0" @@ -9369,7 +7540,7 @@ "node_modules/path-root-regex": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", - "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=", + "integrity": "sha512-4GlJ6rZDhQZFE0DPVKh0e9jmZ5egZfxTkp7bcRDuPlJXbAwhxcl2dINPUAsjLdejqaLsCeg8axcLjIbvBjN4pQ==", "dev": true, "engines": { "node": ">=0.10.0" @@ -9415,20 +7586,6 @@ "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", "dev": true }, - "node_modules/path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/pathval": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", @@ -9462,36 +7619,6 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "dev": true, - "dependencies": { - "pinkie": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/plugin-error": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-1.0.1.tgz", @@ -9551,15 +7678,6 @@ "ms": "^2.1.1" } }, - "node_modules/posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/postcss": { "version": "7.0.39", "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz", @@ -9611,15 +7729,6 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "node_modules/pretty-hrtime": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", - "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", @@ -9693,27 +7802,6 @@ "once": "^1.3.1" } }, - "node_modules/pumpify": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", - "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", - "dev": true, - "dependencies": { - "duplexify": "^3.6.0", - "inherits": "^2.0.3", - "pump": "^2.0.0" - } - }, - "node_modules/pumpify/node_modules/pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "dev": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -9886,15 +7974,15 @@ } }, "node_modules/rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz", + "integrity": "sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==", "dev": true, "dependencies": { - "resolve": "^1.1.6" + "resolve": "^1.20.0" }, "engines": { - "node": ">= 0.10" + "node": ">= 10.13.0" } }, "node_modules/regenerator-runtime": { @@ -9903,107 +7991,28 @@ "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", "dev": true }, - "node_modules/regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "dependencies": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/remove-bom-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz", - "integrity": "sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ==", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5", - "is-utf8": "^0.2.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/remove-bom-stream": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz", - "integrity": "sha1-BfGlk/FuQuH7kOv1nejlaVJflSM=", - "dev": true, - "dependencies": { - "remove-bom-buffer": "^3.0.0", - "safe-buffer": "^5.1.0", - "through2": "^2.0.3" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/remove-bom-stream/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/remove-bom-stream/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, "node_modules/remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", "dev": true }, - "node_modules/repeat-element": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz", - "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==", + "node_modules/replace-ext": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-2.0.0.tgz", + "integrity": "sha512-UszKE5KVK6JvyD92nzMn9cDapSk6w/CaFZ96CnmDMUqH9oowfxF/ZjRITD25H4DnOQClLA4/j7jLGXXLVKxAug==", "dev": true, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true, - "engines": { - "node": ">=0.10" + "node": ">= 10" } }, "node_modules/replace-homedir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/replace-homedir/-/replace-homedir-1.0.0.tgz", - "integrity": "sha1-6H9tUTuSjd6AgmDBK+f+xv9ueYw=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/replace-homedir/-/replace-homedir-2.0.0.tgz", + "integrity": "sha512-bgEuQQ/BHW0XkkJtawzrfzHFSN70f/3cNOiHa2QsYxqrjaC30X1k74FJ6xswVBP0sr0SpGIdVFuPwfrYziVeyw==", "dev": true, - "dependencies": { - "homedir-polyfill": "^1.0.1", - "is-absolute": "^1.0.0", - "remove-trailing-separator": "^1.1.0" - }, "engines": { - "node": ">= 0.10" + "node": ">= 10.13.0" } }, "node_modules/replacestream": { @@ -10059,12 +8068,6 @@ "node": ">=0.10.0" } }, - "node_modules/require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", - "dev": true - }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", @@ -10096,7 +8099,7 @@ "node_modules/resolve-dir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", - "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", + "integrity": "sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==", "dev": true, "dependencies": { "expand-tilde": "^2.0.0", @@ -10116,24 +8119,17 @@ } }, "node_modules/resolve-options": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/resolve-options/-/resolve-options-1.1.0.tgz", - "integrity": "sha1-MrueOcBtZzONyTeMDW1gdFZq0TE=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-options/-/resolve-options-2.0.0.tgz", + "integrity": "sha512-/FopbmmFOQCfsCx77BRFdKOniglTiHumLgwvd6IDPihy1GKkadZbgQJBcTb2lMzSR1pndzd96b1nZrreZ7+9/A==", "dev": true, "dependencies": { - "value-or-function": "^3.0.0" + "value-or-function": "^4.0.0" }, "engines": { - "node": ">= 0.10" + "node": ">= 10.13.0" } }, - "node_modules/resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "deprecated": "https://github.com/lydell/resolve-url#deprecated", - "dev": true - }, "node_modules/responselike": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", @@ -10164,15 +8160,6 @@ "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", "dev": true }, - "node_modules/ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true, - "engines": { - "node": ">=0.12" - } - }, "node_modules/reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -10254,15 +8241,6 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, - "node_modules/safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "dependencies": { - "ret": "~0.1.10" - } - }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -10301,15 +8279,15 @@ } }, "node_modules/semver-greatest-satisfied-range": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz", - "integrity": "sha1-E+jCZYq5aRywzXEJMkAoDTb3els=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-2.0.0.tgz", + "integrity": "sha512-lH3f6kMbwyANB7HuOWRMlLCa2itaCrZJ+SAqqkSZrZKO/cAsk2EOyaKHUtNkVLFyFW9pct22SFesFp3Z7zpA0g==", "dev": true, "dependencies": { - "sver-compat": "^1.5.0" + "sver": "^1.8.3" }, "engines": { - "node": ">= 0.10" + "node": ">= 10.13.0" } }, "node_modules/serialize-error": { @@ -10336,60 +8314,6 @@ "randombytes": "^2.1.0" } }, - "node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, - "node_modules/set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", - "dev": true, - "dependencies": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/set-value/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/set-value/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/set-value/node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", @@ -10490,198 +8414,6 @@ "npm": ">= 3.0.0" } }, - "node_modules/snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "dev": true, - "dependencies": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "dev": true, - "dependencies": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-node/node_modules/define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "dependencies": { - "is-descriptor": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "dev": true, - "dependencies": { - "kind-of": "^3.2.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-util/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/snapdragon/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/is-accessor-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/is-data-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "node_modules/snapdragon/node_modules/source-map-resolve": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", - "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", - "dev": true, - "dependencies": { - "atob": "^2.1.2", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, "node_modules/socks": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", @@ -10735,12 +8467,6 @@ "decode-uri-component": "^0.2.0" } }, - "node_modules/source-map-url": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", - "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", - "dev": true - }, "node_modules/spacetrim": { "version": "0.11.36", "resolved": "https://registry.npmjs.org/spacetrim/-/spacetrim-0.11.36.tgz", @@ -10758,12 +8484,12 @@ ] }, "node_modules/sparkles": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz", - "integrity": "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-2.1.0.tgz", + "integrity": "sha512-r7iW1bDw8R/cFifrD3JnQJX0K1jqT0kprL48BiBpLZLJPmAm34zsVBsK5lc7HirZYZqMW65dOXZgbAGt/I6frg==", "dev": true, "engines": { - "node": ">= 0.10" + "node": ">= 10.13.0" } }, "node_modules/spawn-command": { @@ -10772,50 +8498,18 @@ "integrity": "sha512-zC8zGoGkmc8J9ndvml8Xksr1Amk9qBujgbF0JAIWO7kXr43w0h/0GJNM/Vustixu+YE8N/MTrQ7N31FvHUACxQ==", "dev": true }, - "node_modules/spdx-correct": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", - "dev": true, - "dependencies": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, "node_modules/spdx-exceptions": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", "dev": true }, - "node_modules/spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dev": true, - "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, "node_modules/spdx-license-ids": { "version": "3.0.11", "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz", "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==", "dev": true }, - "node_modules/split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "dev": true, - "dependencies": { - "extend-shallow": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/split2": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", @@ -10831,100 +8525,13 @@ "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", "dev": true }, - "node_modules/stack-trace": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", - "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "node_modules/stream-composer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/stream-composer/-/stream-composer-1.0.2.tgz", + "integrity": "sha512-bnBselmwfX5K10AH6L4c8+S5lgZMWI7ZYrz2rvYjCPB2DIMC4Ig8OpxGpNJSxRZ58oti7y1IcNvjBAz9vW5m4w==", "dev": true, "dependencies": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-extend/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-extend/node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-extend/node_modules/is-accessor-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-extend/node_modules/is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-extend/node_modules/is-data-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-extend/node_modules/is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "engines": { - "node": ">=0.10.0" + "streamx": "^2.13.2" } }, "node_modules/stream-exhaust": { @@ -10933,12 +8540,6 @@ "integrity": "sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==", "dev": true }, - "node_modules/stream-shift": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", - "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", - "dev": true - }, "node_modules/stream-to-array": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/stream-to-array/-/stream-to-array-2.3.0.tgz", @@ -11088,18 +8689,6 @@ "node": ">=8" } }, - "node_modules/strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "dependencies": { - "is-utf8": "^0.2.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/strip-bom-string": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", @@ -11145,14 +8734,23 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/sver-compat": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/sver-compat/-/sver-compat-1.5.0.tgz", - "integrity": "sha1-PPh9/rTQe0o/FIJ7wYaz/QxkXNg=", + "node_modules/sver": { + "version": "1.8.4", + "resolved": "https://registry.npmjs.org/sver/-/sver-1.8.4.tgz", + "integrity": "sha512-71o1zfzyawLfIWBOmw8brleKyvnbn73oVHNCsu51uPMz/HWiKkkXsI31JjHW5zqXEqnPYkIiHd8ZmL7FCimLEA==", "dev": true, - "dependencies": { - "es6-iterator": "^2.0.1", - "es6-symbol": "^3.1.1" + "optionalDependencies": { + "semver": "^6.3.0" + } + }, + "node_modules/sver/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "optional": true, + "bin": { + "semver": "bin/semver.js" } }, "node_modules/symbol-tree": { @@ -11204,6 +8802,15 @@ "streamx": "^2.15.0" } }, + "node_modules/teex": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/teex/-/teex-1.0.1.tgz", + "integrity": "sha512-eYE6iEI62Ni1H8oIa7KlDU6uQBtqr4Eajni3wX7rpfXD8ysFx8z0+dri+KWEPWpBsxXfxu58x/0jvTVT1ekOSg==", + "dev": true, + "dependencies": { + "streamx": "^2.12.5" + } + }, "node_modules/text-decoder": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.1.0.tgz", @@ -11237,41 +8844,6 @@ "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", "dev": true }, - "node_modules/through2-filter": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz", - "integrity": "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==", - "dev": true, - "dependencies": { - "through2": "~2.0.0", - "xtend": "~4.0.0" - } - }, - "node_modules/through2-filter/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/through2-filter/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, "node_modules/time-stamp": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", @@ -11303,58 +8875,6 @@ "node": ">=0.6.0" } }, - "node_modules/to-absolute-glob": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", - "integrity": "sha1-GGX0PZ50sIItufFFt4z/fQ98hJs=", - "dev": true, - "dependencies": { - "is-absolute": "^1.0.0", - "is-negated-glob": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/to-object-path/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "dev": true, - "dependencies": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -11367,50 +8887,16 @@ "node": ">=8.0" } }, - "node_modules/to-regex-range/node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, "node_modules/to-through": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-through/-/to-through-2.0.0.tgz", - "integrity": "sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/to-through/-/to-through-3.0.0.tgz", + "integrity": "sha512-y8MN937s/HVhEoBU1SxfHC+wxCHkV1a9gW8eAdTadYh/bGyesZIVcbjI+mSpFbSVwQici/XjBjuUyri1dnXwBw==", "dev": true, "dependencies": { - "through2": "^2.0.3" + "streamx": "^2.12.5" }, "engines": { - "node": ">= 0.10" - } - }, - "node_modules/to-through/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/to-through/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" + "node": ">=10.13.0" } }, "node_modules/tough-cookie": { @@ -11539,47 +9025,44 @@ "node_modules/unc-path-regex": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", - "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", + "integrity": "sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/undertaker": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/undertaker/-/undertaker-1.3.0.tgz", - "integrity": "sha512-/RXwi5m/Mu3H6IHQGww3GNt1PNXlbeCuclF2QYR14L/2CHPz3DFZkvB5hZ0N/QUkiXWCACML2jXViIQEQc2MLg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/undertaker/-/undertaker-2.0.0.tgz", + "integrity": "sha512-tO/bf30wBbTsJ7go80j0RzA2rcwX6o7XPBpeFcb+jzoeb4pfMM2zUeSDIkY1AWqeZabWxaQZ/h8N9t35QKDLPQ==", "dev": true, "dependencies": { - "arr-flatten": "^1.0.1", - "arr-map": "^2.0.0", - "bach": "^1.0.0", - "collection-map": "^1.0.0", - "es6-weak-map": "^2.0.1", - "fast-levenshtein": "^1.0.0", - "last-run": "^1.1.0", - "object.defaults": "^1.0.0", - "object.reduce": "^1.0.0", - "undertaker-registry": "^1.0.0" + "bach": "^2.0.1", + "fast-levenshtein": "^3.0.0", + "last-run": "^2.0.0", + "undertaker-registry": "^2.0.0" }, "engines": { - "node": ">= 0.10" + "node": ">=10.13.0" } }, "node_modules/undertaker-registry": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/undertaker-registry/-/undertaker-registry-1.0.1.tgz", - "integrity": "sha1-XkvaMI5KiirlhPm5pDWaSZglzFA=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/undertaker-registry/-/undertaker-registry-2.0.0.tgz", + "integrity": "sha512-+hhVICbnp+rlzZMgxXenpvTxpuvA67Bfgtt+O9WOE5jo7w/dyiF1VmoZVIHvP2EkUjsyKyTwYKlLhA+j47m1Ew==", "dev": true, "engines": { - "node": ">= 0.10" + "node": ">= 10.13.0" } }, "node_modules/undertaker/node_modules/fast-levenshtein": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-1.1.4.tgz", - "integrity": "sha1-5qdUzI8V5YmHqpy9J69m/W9OWvk=", - "dev": true + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-3.0.0.tgz", + "integrity": "sha512-hKKNajm46uNmTlhHSyZkmToAc56uZJwYq7yrciZjqOxnlfQwERDQJmHPUp7m1m9wx8vgOe8IaCKZ5Kv2k1DdCQ==", + "dev": true, + "dependencies": { + "fastest-levenshtein": "^1.0.7" + } }, "node_modules/union": { "version": "0.5.0", @@ -11593,40 +9076,6 @@ "node": ">= 0.8.0" } }, - "node_modules/union-value": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", - "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", - "dev": true, - "dependencies": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/union-value/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/unique-stream": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.3.1.tgz", - "integrity": "sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A==", - "dev": true, - "dependencies": { - "json-stable-stringify-without-jsonify": "^1.0.1", - "through2-filter": "^3.0.0" - } - }, "node_modules/universalify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", @@ -11636,64 +9085,6 @@ "node": ">= 10.0.0" } }, - "node_modules/unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "dependencies": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/unset-value/node_modules/has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "dev": true, - "dependencies": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/unset-value/node_modules/has-value/node_modules/isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "dependencies": { - "isarray": "1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/unset-value/node_modules/has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/upath": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", - "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", - "dev": true, - "engines": { - "node": ">=4", - "yarn": "*" - } - }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -11703,13 +9094,6 @@ "punycode": "^2.1.0" } }, - "node_modules/urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "deprecated": "Please see https://github.com/lydell/urix#deprecated", - "dev": true - }, "node_modules/url-join": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz", @@ -11725,15 +9109,6 @@ "requires-port": "^1.0.0" } }, - "node_modules/use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/userhome": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/userhome/-/userhome-1.0.0.tgz", @@ -11759,34 +9134,21 @@ } }, "node_modules/v8flags": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.2.0.tgz", - "integrity": "sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-4.0.1.tgz", + "integrity": "sha512-fcRLaS4H/hrZk9hYwbdRM35D0U8IYMfEClhXxCivOojl+yTRAZH3Zy2sSy6qVCiGbV9YAtPssP6jaChqC9vPCg==", "dev": true, - "dependencies": { - "homedir-polyfill": "^1.0.1" - }, "engines": { - "node": ">= 0.10" - } - }, - "node_modules/validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "dependencies": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" + "node": ">= 10.13.0" } }, "node_modules/value-or-function": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz", - "integrity": "sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/value-or-function/-/value-or-function-4.0.0.tgz", + "integrity": "sha512-aeVK81SIuT6aMJfNo9Vte8Dw0/FZINGBV8BfCraGtqVxIeLAEhJyoWs8SmvRVmXfGss2PmmOwZCuBPbZR+IYWg==", "dev": true, "engines": { - "node": ">= 0.10" + "node": ">= 10.13.0" } }, "node_modules/vinyl": { @@ -11806,87 +9168,113 @@ "node": ">= 0.10" } }, - "node_modules/vinyl-fs": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz", - "integrity": "sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==", + "node_modules/vinyl-contents": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/vinyl-contents/-/vinyl-contents-2.0.0.tgz", + "integrity": "sha512-cHq6NnGyi2pZ7xwdHSW1v4Jfnho4TEGtxZHw01cmnc8+i7jgR6bRnED/LbrKan/Q7CvVLbnvA5OepnhbpjBZ5Q==", "dev": true, "dependencies": { - "fs-mkdirp-stream": "^1.0.0", - "glob-stream": "^6.1.0", - "graceful-fs": "^4.0.0", - "is-valid-glob": "^1.0.0", - "lazystream": "^1.0.0", - "lead": "^1.0.0", - "object.assign": "^4.0.4", - "pumpify": "^1.3.5", - "readable-stream": "^2.3.3", - "remove-bom-buffer": "^3.0.0", - "remove-bom-stream": "^1.2.0", - "resolve-options": "^1.1.0", - "through2": "^2.0.0", - "to-through": "^2.0.0", - "value-or-function": "^3.0.0", - "vinyl": "^2.0.0", - "vinyl-sourcemap": "^1.1.0" + "bl": "^5.0.0", + "vinyl": "^3.0.0" }, "engines": { - "node": ">= 0.10" + "node": ">=10.13.0" } }, - "node_modules/vinyl-fs/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "node_modules/vinyl-contents/node_modules/vinyl": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-3.0.0.tgz", + "integrity": "sha512-rC2VRfAVVCGEgjnxHUnpIVh3AGuk62rP3tqVrn+yab0YH7UULisC085+NYH+mnqf3Wx4SpSi1RQMwudL89N03g==", "dev": true, "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "clone": "^2.1.2", + "clone-stats": "^1.0.0", + "remove-trailing-separator": "^1.1.0", + "replace-ext": "^2.0.0", + "teex": "^1.0.1" + }, + "engines": { + "node": ">=10.13.0" } }, - "node_modules/vinyl-fs/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "node_modules/vinyl-fs": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-4.0.0.tgz", + "integrity": "sha512-7GbgBnYfaquMk3Qu9g22x000vbYkOex32930rBnc3qByw6HfMEAoELjCjoJv4HuEQxHAurT+nvMHm6MnJllFLw==", "dev": true, "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" + "fs-mkdirp-stream": "^2.0.1", + "glob-stream": "^8.0.0", + "graceful-fs": "^4.2.11", + "iconv-lite": "^0.6.3", + "is-valid-glob": "^1.0.0", + "lead": "^4.0.0", + "normalize-path": "3.0.0", + "resolve-options": "^2.0.0", + "stream-composer": "^1.0.2", + "streamx": "^2.14.0", + "to-through": "^3.0.0", + "value-or-function": "^4.0.0", + "vinyl": "^3.0.0", + "vinyl-sourcemap": "^2.0.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/vinyl-fs/node_modules/vinyl": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-3.0.0.tgz", + "integrity": "sha512-rC2VRfAVVCGEgjnxHUnpIVh3AGuk62rP3tqVrn+yab0YH7UULisC085+NYH+mnqf3Wx4SpSi1RQMwudL89N03g==", + "dev": true, + "dependencies": { + "clone": "^2.1.2", + "clone-stats": "^1.0.0", + "remove-trailing-separator": "^1.1.0", + "replace-ext": "^2.0.0", + "teex": "^1.0.1" + }, + "engines": { + "node": ">=10.13.0" } }, "node_modules/vinyl-sourcemap": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz", - "integrity": "sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-2.0.0.tgz", + "integrity": "sha512-BAEvWxbBUXvlNoFQVFVHpybBbjW1r03WhohJzJDSfgrrK5xVYIDTan6xN14DlyImShgDRv2gl9qhM6irVMsV0Q==", "dev": true, "dependencies": { - "append-buffer": "^1.0.2", - "convert-source-map": "^1.5.0", - "graceful-fs": "^4.1.6", - "normalize-path": "^2.1.1", - "now-and-later": "^2.0.0", - "remove-bom-buffer": "^3.0.0", - "vinyl": "^2.0.0" + "convert-source-map": "^2.0.0", + "graceful-fs": "^4.2.10", + "now-and-later": "^3.0.0", + "streamx": "^2.12.5", + "vinyl": "^3.0.0", + "vinyl-contents": "^2.0.0" }, "engines": { - "node": ">= 0.10" + "node": ">=10.13.0" } }, - "node_modules/vinyl-sourcemap/node_modules/normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "node_modules/vinyl-sourcemap/node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, + "node_modules/vinyl-sourcemap/node_modules/vinyl": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-3.0.0.tgz", + "integrity": "sha512-rC2VRfAVVCGEgjnxHUnpIVh3AGuk62rP3tqVrn+yab0YH7UULisC085+NYH+mnqf3Wx4SpSi1RQMwudL89N03g==", "dev": true, "dependencies": { - "remove-trailing-separator": "^1.0.1" + "clone": "^2.1.2", + "clone-stats": "^1.0.0", + "remove-trailing-separator": "^1.1.0", + "replace-ext": "^2.0.0", + "teex": "^1.0.1" }, "engines": { - "node": ">=0.10.0" + "node": ">=10.13.0" } }, "node_modules/vinyl-sourcemaps-apply": { @@ -12105,12 +9493,6 @@ "node": ">= 8" } }, - "node_modules/which-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", - "dev": true - }, "node_modules/workerpool": { "version": "6.5.1", "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", diff --git a/package.json b/package.json index 4df66d662..38e620200 100644 --- a/package.json +++ b/package.json @@ -118,7 +118,7 @@ "eslint-plugin-jsdoc": "^48.0.2", "glob": "^10.3.4", "google-closure-compiler": "^20240317.0.0", - "gulp": "^4.0.2", + "gulp": "^5.0.0", "gulp-concat": "^2.6.1", "gulp-gzip": "^1.4.2", "gulp-header": "^2.0.9", From f4731f2caf875902541649dbc38d0b1df6d02821 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 08:05:49 -0700 Subject: [PATCH 21/90] chore(deps): bump @hyperjump/json-schema from 1.9.3 to 1.9.6 (#8482) Bumps [@hyperjump/json-schema](https://github.com/hyperjump-io/json-schema) from 1.9.3 to 1.9.6. - [Commits](https://github.com/hyperjump-io/json-schema/compare/v1.9.3...v1.9.6) --- updated-dependencies: - dependency-name: "@hyperjump/json-schema" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9d441b410..dde5aaa9c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -501,9 +501,9 @@ } }, "node_modules/@hyperjump/json-schema": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/@hyperjump/json-schema/-/json-schema-1.9.3.tgz", - "integrity": "sha512-NZyQ+PSQKUVIO0PInwqk2EOOObJD/ZqR9awzZeOddwtJyLZaxim9/xizZ6gGxGZi5ZGIdIB1mkBTM9fBu85E4A==", + "version": "1.9.6", + "resolved": "https://registry.npmjs.org/@hyperjump/json-schema/-/json-schema-1.9.6.tgz", + "integrity": "sha512-tv0JLDESJCGEPR1LNDNHEdr/AV+kjmfwpsayNPnk8Qy55VPZvXpr5SpExlq8HwB9IXJp1ScfIcrcVrpaWN2Yxw==", "dev": true, "dependencies": { "@hyperjump/json-pointer": "^1.1.0", From 7ca84603f6d6a6b7583e04687730f1d34f4fafa7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 09:40:54 -0700 Subject: [PATCH 22/90] chore(deps): bump google-github-actions/deploy-appengine (#8483) Bumps [google-github-actions/deploy-appengine](https://github.com/google-github-actions/deploy-appengine) from 2.1.2 to 2.1.3. - [Release notes](https://github.com/google-github-actions/deploy-appengine/releases) - [Changelog](https://github.com/google-github-actions/deploy-appengine/blob/main/CHANGELOG.md) - [Commits](https://github.com/google-github-actions/deploy-appengine/compare/v2.1.2...v2.1.3) --- updated-dependencies: - dependency-name: google-github-actions/deploy-appengine dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/appengine_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/appengine_deploy.yml b/.github/workflows/appengine_deploy.yml index ab8c6bc2e..438d2f094 100644 --- a/.github/workflows/appengine_deploy.yml +++ b/.github/workflows/appengine_deploy.yml @@ -42,7 +42,7 @@ jobs: path: _deploy/ - name: Deploy to App Engine - uses: google-github-actions/deploy-appengine@v2.1.2 + uses: google-github-actions/deploy-appengine@v2.1.3 # For parameters see: # https://github.com/google-github-actions/deploy-appengine#inputs with: From c0c365a5daae131c2b1be57b31a0e43a56e72853 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 09:42:41 -0700 Subject: [PATCH 23/90] chore(deps): bump the npm_and_yarn group across 1 directory with 4 updates (#8476) Bumps the npm_and_yarn group with 4 updates in the / directory: [follow-redirects](https://github.com/follow-redirects/follow-redirects), [ip](https://github.com/indutny/node-ip), [pac-resolver](https://github.com/TooTallNate/proxy-agents/tree/HEAD/packages/pac-resolver) and [socks](https://github.com/JoshGlazebrook/socks). Updates `follow-redirects` from 1.15.4 to 1.15.6 - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.4...v1.15.6) Removes `ip` Updates `pac-resolver` from 7.0.0 to 7.0.1 - [Release notes](https://github.com/TooTallNate/proxy-agents/releases) - [Changelog](https://github.com/TooTallNate/proxy-agents/blob/main/packages/pac-resolver/CHANGELOG.md) - [Commits](https://github.com/TooTallNate/proxy-agents/commits/pac-resolver@7.0.1/packages/pac-resolver) Updates `socks` from 2.7.1 to 2.8.3 - [Release notes](https://github.com/JoshGlazebrook/socks/releases) - [Commits](https://github.com/JoshGlazebrook/socks/compare/2.7.1...2.8.3) Updates `pac-resolver` from 7.0.0 to 7.0.1 - [Release notes](https://github.com/TooTallNate/proxy-agents/releases) - [Changelog](https://github.com/TooTallNate/proxy-agents/blob/main/packages/pac-resolver/CHANGELOG.md) - [Commits](https://github.com/TooTallNate/proxy-agents/commits/pac-resolver@7.0.1/packages/pac-resolver) Updates `socks` from 2.7.1 to 2.8.3 - [Release notes](https://github.com/JoshGlazebrook/socks/releases) - [Commits](https://github.com/JoshGlazebrook/socks/compare/2.7.1...2.8.3) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: ip dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: pac-resolver dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: socks dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: pac-resolver dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: socks dependency-type: indirect dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 56 ++++++++++++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 22 deletions(-) diff --git a/package-lock.json b/package-lock.json index dde5aaa9c..02f14699d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4526,9 +4526,9 @@ "dev": true }, "node_modules/follow-redirects": { - "version": "1.15.4", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz", - "integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==", + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", "dev": true, "funding": [ { @@ -5880,10 +5880,23 @@ "node": ">=10.13.0" } }, - "node_modules/ip": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.9.tgz", - "integrity": "sha512-cyRxvOEpNHNtchU3Ln9KC/auJgup87llfQpQ+t5ghoC/UhL16SWzbueiCsdTnWmqAWl7LadfuwhlqmtOaqMHdQ==", + "node_modules/ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "dev": true, + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/ip-address/node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", "dev": true }, "node_modules/is-absolute": { @@ -6190,6 +6203,12 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", + "dev": true + }, "node_modules/jsdoc-type-pratt-parser": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz", @@ -7319,13 +7338,12 @@ } }, "node_modules/pac-resolver": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.0.tgz", - "integrity": "sha512-Fd9lT9vJbHYRACT8OhCbZBbxr6KRSawSovFpy8nDGshaK99S/EBhVIHp9+crhxrsZOuvLpgL1n23iyPg6Rl2hg==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.1.tgz", + "integrity": "sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg==", "dev": true, "dependencies": { "degenerator": "^5.0.0", - "ip": "^1.1.8", "netmask": "^2.0.2" }, "engines": { @@ -8415,16 +8433,16 @@ } }, "node_modules/socks": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", - "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.3.tgz", + "integrity": "sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==", "dev": true, "dependencies": { - "ip": "^2.0.0", + "ip-address": "^9.0.5", "smart-buffer": "^4.2.0" }, "engines": { - "node": ">= 10.13.0", + "node": ">= 10.0.0", "npm": ">= 3.0.0" } }, @@ -8442,12 +8460,6 @@ "node": ">= 14" } }, - "node_modules/socks/node_modules/ip": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.1.tgz", - "integrity": "sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ==", - "dev": true - }, "node_modules/source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", From f57ef73aaffa196a12682ee55a0a0c1336f8732f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Aug 2024 09:10:34 -0700 Subject: [PATCH 24/90] chore(deps): bump @typescript-eslint/eslint-plugin from 7.17.0 to 8.0.1 (#8479) * chore(deps): bump @typescript-eslint/eslint-plugin from 7.17.0 to 8.0.1 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 7.17.0 to 8.0.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.0.1/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * fix: lint plugin versions * chore: fix linting --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Beka Westberg --- .eslintrc.js | 2 + core/block.ts | 12 +- core/block_svg.ts | 4 +- core/browser_events.ts | 8 +- core/dragging/bubble_drag_strategy.ts | 4 +- core/dropdowndiv.ts | 10 +- core/events/utils.ts | 2 +- core/extensions.ts | 5 +- core/field.ts | 12 +- core/flyout_base.ts | 2 +- core/flyout_metrics_manager.ts | 2 +- core/insertion_marker_manager.ts | 2 +- core/interfaces/i_comment_icon.ts | 2 +- core/interfaces/i_legacy_procedure_blocks.ts | 4 +- core/interfaces/i_selectable.ts | 2 +- core/interfaces/i_serializer.ts | 4 +- core/menuitem.ts | 2 +- core/registry.ts | 2 +- core/rendered_connection.ts | 11 +- core/renderers/common/block_rendering.ts | 5 +- core/renderers/common/marker_svg.ts | 8 +- core/renderers/measurables/types.ts | 3 + core/serialization/procedures.ts | 4 +- core/toolbox/category.ts | 16 +- core/tooltip.ts | 2 +- core/utils/dom.ts | 2 +- core/widgetdiv.ts | 2 +- core/workspace.ts | 6 +- core/workspace_audio.ts | 2 +- core/workspace_svg.ts | 2 +- package-lock.json | 493 ++++++------------- package.json | 4 +- tests/typescript/src/generators.ts | 2 + 33 files changed, 246 insertions(+), 397 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 14d27ca1a..5b539133b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -101,6 +101,8 @@ function buildTSOverride({files, tsconfig}) { '@typescript-eslint/no-empty-function': ['off'], // Temporarily disable. 3 problems. '@typescript-eslint/no-empty-interface': ['off'], + // We use this pattern extensively for block (e.g. controls_if) interfaces. + '@typescript-eslint/no-empty-object-type': ['off'], // TsDoc rules (using JsDoc plugin) // Disable built-in jsdoc verifier. diff --git a/core/block.ts b/core/block.ts index 6db948e48..dad2fd6e9 100644 --- a/core/block.ts +++ b/core/block.ts @@ -223,7 +223,7 @@ export class Block implements IASTNodeLocation { /** * String for block help, or function that returns a URL. Null for no help. */ - helpUrl: string | Function | null = null; + helpUrl: string | (() => string) | null = null; /** A bound callback function to use when the parent workspace changes. */ private onchangeWrapper_: ((p1: Abstract) => void) | null = null; @@ -997,7 +997,7 @@ export class Block implements IASTNodeLocation { * @param url URL string for block help, or function that returns a URL. Null * for no help. */ - setHelpUrl(url: string | Function) { + setHelpUrl(url: string | (() => string)) { this.helpUrl = url; } @@ -1864,7 +1864,7 @@ export class Block implements IASTNodeLocation { const rawValue = json['colour']; try { this.setColour(rawValue); - } catch (e) { + } catch { console.warn(warningPrefix + 'Illegal colour value: ', rawValue); } } @@ -1881,7 +1881,7 @@ export class Block implements IASTNodeLocation { const blockStyleName = json['style']; try { this.setStyle(blockStyleName); - } catch (styleError) { + } catch { console.warn(warningPrefix + 'Style does not exist: ', blockStyleName); } } @@ -2461,7 +2461,9 @@ export class Block implements IASTNodeLocation { const event = new (eventUtils.get(eventUtils.BLOCK_MOVE))( this, ) as BlockMove; - reason && event.setReason(reason); + if (reason) { + event.setReason(reason); + } this.xy_.translate(dx, dy); event.recordNew(); eventUtils.fire(event); diff --git a/core/block_svg.ts b/core/block_svg.ts index 14c580574..275451a61 100644 --- a/core/block_svg.ts +++ b/core/block_svg.ts @@ -378,7 +378,9 @@ export class BlockSvg let event: BlockMove | null = null; if (eventsEnabled) { event = new (eventUtils.get(eventUtils.BLOCK_MOVE)!)(this) as BlockMove; - reason && event.setReason(reason); + if (reason) { + event.setReason(reason); + } } const delta = new Coordinate(dx, dy); diff --git a/core/browser_events.ts b/core/browser_events.ts index 54fec307e..8176fe10f 100644 --- a/core/browser_events.ts +++ b/core/browser_events.ts @@ -6,6 +6,10 @@ // Former goog.module ID: Blockly.browserEvents +// Theoretically we could figure out a way to type the event params correctly, +// but it's not high priority. +/* eslint-disable @typescript-eslint/no-unsafe-function-type */ + import * as Touch from './touch.js'; import * as userAgent from './utils/useragent.js'; @@ -47,7 +51,7 @@ const PAGE_MODE_MULTIPLIER = 125; export function conditionalBind( node: EventTarget, name: string, - thisObject: Object | null, + thisObject: object | null, func: Function, opt_noCaptureIdentifier?: boolean, ): Data { @@ -96,7 +100,7 @@ export function conditionalBind( export function bind( node: EventTarget, name: string, - thisObject: Object | null, + thisObject: object | null, func: Function, ): Data { /** diff --git a/core/dragging/bubble_drag_strategy.ts b/core/dragging/bubble_drag_strategy.ts index f388bb94c..05465a804 100644 --- a/core/dragging/bubble_drag_strategy.ts +++ b/core/dragging/bubble_drag_strategy.ts @@ -33,7 +33,9 @@ export class BubbleDragStrategy implements IDragStrategy { this.startLoc = this.bubble.getRelativeToSurfaceXY(); this.workspace.setResizesEnabled(false); this.workspace.getLayerManager()?.moveToDragLayer(this.bubble); - this.bubble.setDragging && this.bubble.setDragging(true); + if (this.bubble.setDragging) { + this.bubble.setDragging(true); + } } drag(newLoc: Coordinate): void { diff --git a/core/dropdowndiv.ts b/core/dropdowndiv.ts index c90661c4e..5b531912a 100644 --- a/core/dropdowndiv.ts +++ b/core/dropdowndiv.ts @@ -53,7 +53,7 @@ export const ANIMATION_TIME = 0.25; let animateOutTimer: ReturnType | null = null; /** Callback for when the drop-down is hidden. */ -let onHide: Function | null = null; +let onHide: (() => void) | null = null; /** A class name representing the current owner's workspace renderer. */ let renderedClassName = ''; @@ -202,7 +202,7 @@ export function setColour(backgroundColour: string, borderColour: string) { export function showPositionedByBlock( field: Field, block: BlockSvg, - opt_onHide?: Function, + opt_onHide?: () => void, opt_secondaryYOffset?: number, ): boolean { return showPositionedByRect( @@ -226,7 +226,7 @@ export function showPositionedByBlock( */ export function showPositionedByField( field: Field, - opt_onHide?: Function, + opt_onHide?: () => void, opt_secondaryYOffset?: number, ): boolean { positionToField = true; @@ -278,7 +278,7 @@ function getScaledBboxOfField(field: Field): Rect { function showPositionedByRect( bBox: Rect, field: Field, - opt_onHide?: Function, + opt_onHide?: () => void, opt_secondaryYOffset?: number, ): boolean { // If we can fit it, render below the block. @@ -334,7 +334,7 @@ export function show( primaryY: number, secondaryX: number, secondaryY: number, - opt_onHide?: Function, + opt_onHide?: () => void, ): boolean { owner = newOwner as Field; onHide = opt_onHide || null; diff --git a/core/events/utils.ts b/core/events/utils.ts index 2d434594b..0bb69980e 100644 --- a/core/events/utils.ts +++ b/core/events/utils.ts @@ -256,7 +256,7 @@ function fireInternal(event: Abstract) { requestAnimationFrame(() => { setTimeout(fireNow, 0); }); - } catch (e) { + } catch { // Otherwise we just want to delay so events can be coallesced. // requestAnimationFrame will error triggering this. setTimeout(fireNow, 0); diff --git a/core/extensions.ts b/core/extensions.ts index aa9a6a186..0957b7f86 100644 --- a/core/extensions.ts +++ b/core/extensions.ts @@ -27,7 +27,10 @@ export const TEST_ONLY = {allExtensions}; * @throws {Error} if the extension name is empty, the extension is already * registered, or extensionFn is not a function. */ -export function register(name: string, initFn: Function) { +export function register( + name: string, + initFn: (this: T) => void, +) { if (typeof name !== 'string' || name.trim() === '') { throw Error('Error: Invalid extension name "' + name + '"'); } diff --git a/core/field.ts b/core/field.ts index 51e006823..777b19f55 100644 --- a/core/field.ts +++ b/core/field.ts @@ -1080,7 +1080,7 @@ export abstract class Field setValue(newValue: AnyDuringMigration, fireChangeEvent = true) { const doLogging = false; if (newValue === null) { - doLogging && console.log('null, return'); + if (doLogging) console.log('null, return'); // Not a valid value to check. return; } @@ -1092,7 +1092,7 @@ export abstract class Field fireChangeEvent, ); if (classValue instanceof Error) { - doLogging && console.log('invalid class validation, return'); + if (doLogging) console.log('invalid class validation, return'); return; } @@ -1103,19 +1103,19 @@ export abstract class Field fireChangeEvent, ); if (localValue instanceof Error) { - doLogging && console.log('invalid local validation, return'); + if (doLogging) console.log('invalid local validation, return'); return; } const source = this.sourceBlock_; if (source && source.disposed) { - doLogging && console.log('source disposed, return'); + if (doLogging) console.log('source disposed, return'); return; } const oldValue = this.getValue(); if (oldValue === localValue) { - doLogging && console.log('same, doValueUpdate_, return'); + if (doLogging) console.log('same, doValueUpdate_, return'); this.doValueUpdate_(localValue); return; } @@ -1135,7 +1135,7 @@ export abstract class Field if (this.isDirty_) { this.forceRerender(); } - doLogging && console.log(this.value_); + if (doLogging) console.log(this.value_); } /** diff --git a/core/flyout_base.ts b/core/flyout_base.ts index 27ad0abf5..e81df4279 100644 --- a/core/flyout_base.ts +++ b/core/flyout_base.ts @@ -1070,7 +1070,7 @@ export abstract class Flyout * @param block The flyout block to copy. * @returns Function to call when block is clicked. */ - private blockMouseDown(block: BlockSvg): Function { + private blockMouseDown(block: BlockSvg) { return (e: PointerEvent) => { const gesture = this.targetWorkspace.getGesture(e); if (gesture) { diff --git a/core/flyout_metrics_manager.ts b/core/flyout_metrics_manager.ts index fadc5deb5..a291f4c3b 100644 --- a/core/flyout_metrics_manager.ts +++ b/core/flyout_metrics_manager.ts @@ -44,7 +44,7 @@ export class FlyoutMetricsManager extends MetricsManager { let blockBoundingBox; try { blockBoundingBox = this.workspace_.getCanvas().getBBox(); - } catch (e) { + } catch { // Firefox has trouble with hidden elements (Bug 528969). // 2021 Update: It looks like this was fixed around Firefox 77 released in // 2020. diff --git a/core/insertion_marker_manager.ts b/core/insertion_marker_manager.ts index 376297f10..6f27eada7 100644 --- a/core/insertion_marker_manager.ts +++ b/core/insertion_marker_manager.ts @@ -529,7 +529,7 @@ export class InsertionMarkerManager { local.getSourceBlock(), local, ); - } catch (e) { + } catch { // It's possible that the number of connections on the local block has // changed since the insertion marker was originally created. Let's // recreate the insertion marker and try again. In theory we could diff --git a/core/interfaces/i_comment_icon.ts b/core/interfaces/i_comment_icon.ts index 09b071110..47c46daaf 100644 --- a/core/interfaces/i_comment_icon.ts +++ b/core/interfaces/i_comment_icon.ts @@ -26,7 +26,7 @@ export interface ICommentIcon extends IIcon, IHasBubble, ISerializable { } /** Checks whether the given object is an ICommentIcon. */ -export function isCommentIcon(obj: Object): obj is ICommentIcon { +export function isCommentIcon(obj: object): obj is ICommentIcon { return ( isIcon(obj) && hasBubble(obj) && diff --git a/core/interfaces/i_legacy_procedure_blocks.ts b/core/interfaces/i_legacy_procedure_blocks.ts index 3bd7e19bf..d74eaec22 100644 --- a/core/interfaces/i_legacy_procedure_blocks.ts +++ b/core/interfaces/i_legacy_procedure_blocks.ts @@ -28,7 +28,7 @@ export interface LegacyProcedureDefBlock { /** @internal */ export function isLegacyProcedureDefBlock( - block: Object, + block: object, ): block is LegacyProcedureDefBlock { return (block as any).getProcedureDef !== undefined; } @@ -41,7 +41,7 @@ export interface LegacyProcedureCallBlock { /** @internal */ export function isLegacyProcedureCallBlock( - block: Object, + block: object, ): block is LegacyProcedureCallBlock { return ( (block as any).getProcedureCall !== undefined && diff --git a/core/interfaces/i_selectable.ts b/core/interfaces/i_selectable.ts index 7cf9ad98c..972b0adb1 100644 --- a/core/interfaces/i_selectable.ts +++ b/core/interfaces/i_selectable.ts @@ -24,7 +24,7 @@ export interface ISelectable { } /** Checks whether the given object is an ISelectable. */ -export function isSelectable(obj: Object): obj is ISelectable { +export function isSelectable(obj: object): obj is ISelectable { return ( typeof (obj as any).id === 'string' && (obj as any).workspace !== undefined && diff --git a/core/interfaces/i_serializer.ts b/core/interfaces/i_serializer.ts index 29c257915..a33e6b225 100644 --- a/core/interfaces/i_serializer.ts +++ b/core/interfaces/i_serializer.ts @@ -31,7 +31,7 @@ export interface ISerializer { * @returns A JS object containing the system's state, or null if there is no * state to record. */ - save(workspace: Workspace): Object | null; + save(workspace: Workspace): object | null; /* eslint-enable valid-jsdoc */ /** @@ -42,7 +42,7 @@ export interface ISerializer { * @param workspace The workspace the system to deserialize is associated * with. */ - load(state: Object, workspace: Workspace): void; + load(state: object, workspace: Workspace): void; /** * Clears the state of the plugin or system. diff --git a/core/menuitem.ts b/core/menuitem.ts index aad914b68..e9e7dc0db 100644 --- a/core/menuitem.ts +++ b/core/menuitem.ts @@ -41,7 +41,7 @@ export class MenuItem { private highlight = false; /** Bound function to call when this menu item is clicked. */ - private actionHandler: Function | null = null; + private actionHandler: ((obj: this) => void) | null = null; /** * @param content Text caption to display as the content of the item, or a diff --git a/core/registry.ts b/core/registry.ts index d46c36f48..39bb83b87 100644 --- a/core/registry.ts +++ b/core/registry.ts @@ -193,7 +193,7 @@ export function register( * @param registryItem A class or object that we are checking for the required * properties. */ -function validate(type: string, registryItem: Function | AnyDuringMigration) { +function validate(type: string, registryItem: AnyDuringMigration) { switch (type) { case String(Type.FIELD): if (typeof registryItem.fromJson !== 'function') { diff --git a/core/rendered_connection.ts b/core/rendered_connection.ts index 5aa6f7f75..27c532839 100644 --- a/core/rendered_connection.ts +++ b/core/rendered_connection.ts @@ -146,7 +146,7 @@ export class RenderedConnection extends Connection { } // Raise it to the top for extra visibility. const selected = common.getSelected() == rootBlock; - selected || rootBlock.addSelect(); + if (!selected) rootBlock.addSelect(); let dx = staticConnection.x + config.snapRadius + @@ -169,7 +169,7 @@ export class RenderedConnection extends Connection { this.x; } rootBlock.moveBy(dx, dy, ['bump']); - selected || rootBlock.removeSelect(); + if (!selected) rootBlock.removeSelect(); } /** @@ -389,9 +389,10 @@ export class RenderedConnection extends Connection { if (block.isCollapsed()) { // This block should only be partially revealed since it is collapsed. connections = []; - block.outputConnection && connections.push(block.outputConnection); - block.nextConnection && connections.push(block.nextConnection); - block.previousConnection && connections.push(block.previousConnection); + if (block.outputConnection) connections.push(block.outputConnection); + if (block.nextConnection) connections.push(block.nextConnection); + if (block.previousConnection) + connections.push(block.previousConnection); } else { // Show all connections of this block. connections = block.getConnections_(true); diff --git a/core/renderers/common/block_rendering.ts b/core/renderers/common/block_rendering.ts index 7c87a8928..741e2367d 100644 --- a/core/renderers/common/block_rendering.ts +++ b/core/renderers/common/block_rendering.ts @@ -45,7 +45,10 @@ import {Renderer} from './renderer.js'; * @param rendererClass The new renderer class to register. * @throws {Error} if a renderer with the same name has already been registered. */ -export function register(name: string, rendererClass: Function) { +export function register( + name: string, + rendererClass: new (name: string) => Renderer, +) { registry.register(registry.Type.RENDERER, name, rendererClass); } diff --git a/core/renderers/common/marker_svg.ts b/core/renderers/common/marker_svg.ts index 995783576..b2005012f 100644 --- a/core/renderers/common/marker_svg.ts +++ b/core/renderers/common/marker_svg.ts @@ -176,9 +176,11 @@ export class MarkerSvg { // Ensures the marker will be visible immediately after the move. const animate = this.currentMarkerSvg!.childNodes[0]; - if (animate !== undefined) { - (animate as SVGAnimationElement).beginElement && - (animate as SVGAnimationElement).beginElement(); + if ( + animate !== undefined && + (animate as SVGAnimationElement).beginElement + ) { + (animate as SVGAnimationElement).beginElement(); } } diff --git a/core/renderers/measurables/types.ts b/core/renderers/measurables/types.ts index a378fc18e..a145b1563 100644 --- a/core/renderers/measurables/types.ts +++ b/core/renderers/measurables/types.ts @@ -13,6 +13,9 @@ import type {Row} from './row.js'; * Types of rendering elements. */ class TypesContainer { + // This class is very non-idiomatic for typescript, so we have to use + // the Function type to make it happy. + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type [index: string]: number | Function; NONE = 0; // None diff --git a/core/serialization/procedures.ts b/core/serialization/procedures.ts index 55d720604..c51a38c82 100644 --- a/core/serialization/procedures.ts +++ b/core/serialization/procedures.ts @@ -44,7 +44,7 @@ interface ProcedureModelConstructor { * @param workspace The workspace to load the procedure model into. * @returns The constructed procedure model. */ - loadState(state: Object, workspace: Workspace): ProcedureModel; + loadState(state: object, workspace: Workspace): ProcedureModel; } /** @@ -64,7 +64,7 @@ interface ParameterModelConstructor { * @param workspace The workspace to load the parameter model into. * @returns The constructed parameter model. */ - loadState(state: Object, workspace: Workspace): ParameterModel; + loadState(state: object, workspace: Workspace): ParameterModel; } /** diff --git a/core/toolbox/category.ts b/core/toolbox/category.ts index 6ff159b0b..9fc2f8a6f 100644 --- a/core/toolbox/category.ts +++ b/core/toolbox/category.ts @@ -248,9 +248,11 @@ export class ToolboxCategory const nestedPadding = `${ ToolboxCategory.nestedPadding * this.getLevel() }px`; - this.workspace_.RTL - ? (rowDiv.style.paddingRight = nestedPadding) - : (rowDiv.style.paddingLeft = nestedPadding); + if (this.workspace_.RTL) { + rowDiv.style.paddingRight = nestedPadding; + } else { + rowDiv.style.paddingLeft = nestedPadding; + } return rowDiv; } @@ -564,9 +566,11 @@ export class ToolboxCategory setDisabled(isDisabled: boolean) { this.isDisabled_ = isDisabled; this.getDiv()!.setAttribute('disabled', `${isDisabled}`); - isDisabled - ? this.getDiv()!.setAttribute('disabled', 'true') - : this.getDiv()!.removeAttribute('disabled'); + if (isDisabled) { + this.getDiv()!.setAttribute('disabled', 'true'); + } else { + this.getDiv()!.removeAttribute('disabled'); + } } /** diff --git a/core/tooltip.ts b/core/tooltip.ts index 0478b91fd..bf379f291 100644 --- a/core/tooltip.ts +++ b/core/tooltip.ts @@ -19,7 +19,7 @@ import * as blocklyString from './utils/string.js'; export type TipInfo = | string | {tooltip: AnyDuringMigration} - | (() => TipInfo | string | Function); + | (() => TipInfo | string); /** * A function that renders custom tooltip UI. diff --git a/core/utils/dom.ts b/core/utils/dom.ts index e318e7e91..309cd3fae 100644 --- a/core/utils/dom.ts +++ b/core/utils/dom.ts @@ -211,7 +211,7 @@ export function getTextWidth(textElement: SVGTextElement): number { // Attempt to compute fetch the width of the SVG text element. try { width = textElement.getComputedTextLength(); - } catch (e) { + } catch { // In other cases where we fail to get the computed text. Instead, use an // approximation and do not cache the result. At some later point in time // when the block is inserted into the visible DOM, this method will be diff --git a/core/widgetdiv.ts b/core/widgetdiv.ts index 9f58bb1c5..b28ec6367 100644 --- a/core/widgetdiv.ts +++ b/core/widgetdiv.ts @@ -126,7 +126,7 @@ export function hide() { div.style.display = 'none'; div.style.left = ''; div.style.top = ''; - dispose && dispose(); + if (dispose) dispose(); dispose = null; div.textContent = ''; diff --git a/core/workspace.ts b/core/workspace.ts index 16f32611b..d092cbc82 100644 --- a/core/workspace.ts +++ b/core/workspace.ts @@ -102,7 +102,7 @@ export class Workspace implements IASTNodeLocation { private readonly topBlocks: Block[] = []; private readonly topComments: WorkspaceComment[] = []; private readonly commentDB = new Map(); - private readonly listeners: Function[] = []; + private readonly listeners: ((e: Abstract) => void)[] = []; protected undoStack_: Abstract[] = []; protected redoStack_: Abstract[] = []; private readonly blockDB = new Map(); @@ -679,7 +679,7 @@ export class Workspace implements IASTNodeLocation { * @param func Function to call. * @returns Obsolete return value, ignore. */ - addChangeListener(func: (e: Abstract) => void): Function { + addChangeListener(func: (e: Abstract) => void): (e: Abstract) => void { this.listeners.push(func); return func; } @@ -689,7 +689,7 @@ export class Workspace implements IASTNodeLocation { * * @param func Function to stop calling. */ - removeChangeListener(func: Function) { + removeChangeListener(func: (e: Abstract) => void) { arrayUtils.removeElem(this.listeners, func); } diff --git a/core/workspace_audio.ts b/core/workspace_audio.ts index c2ab93222..c8d21080c 100644 --- a/core/workspace_audio.ts +++ b/core/workspace_audio.ts @@ -64,7 +64,7 @@ export class WorkspaceAudio { let audioTest; try { audioTest = new globalThis['Audio'](); - } catch (e) { + } catch { // No browser support for Audio. // IE can throw an error even if the Audio object exists. return; diff --git a/core/workspace_svg.ts b/core/workspace_svg.ts index aad748105..82a08b237 100644 --- a/core/workspace_svg.ts +++ b/core/workspace_svg.ts @@ -817,7 +817,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { this.options, ); - CursorClass && this.markerManager.setCursor(new CursorClass()); + if (CursorClass) this.markerManager.setCursor(new CursorClass()); this.renderer.createDom(this.svgGroup_, this.getTheme()); return this.svgGroup_; diff --git a/package-lock.json b/package-lock.json index 02f14699d..227a27031 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,8 +20,8 @@ "@hyperjump/json-schema": "^1.5.0", "@microsoft/api-documenter": "^7.22.4", "@microsoft/api-extractor": "^7.29.5", - "@typescript-eslint/eslint-plugin": "^7.3.1", - "@typescript-eslint/parser": "^7.16.1", + "@typescript-eslint/eslint-plugin": "^8.1.0", + "@typescript-eslint/parser": "^8.1.0", "async-done": "^2.0.0", "chai": "^5.1.1", "concurrently": "^8.0.1", @@ -1301,31 +1301,32 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.17.0.tgz", - "integrity": "sha512-pyiDhEuLM3PuANxH7uNYan1AaFs5XE0zw1hq69JBvGvE7gSuEoQl1ydtEe/XQeoC3GQxLXyOVa5kNOATgM638A==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.1.0.tgz", + "integrity": "sha512-LlNBaHFCEBPHyD4pZXb35mzjGkuGKXU5eeCA1SxvHfiRES0E82dOounfVpL4DCqYvJEKab0bZIA0gCRpdLKkCw==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "7.17.0", - "@typescript-eslint/type-utils": "7.17.0", - "@typescript-eslint/utils": "7.17.0", - "@typescript-eslint/visitor-keys": "7.17.0", + "@typescript-eslint/scope-manager": "8.1.0", + "@typescript-eslint/type-utils": "8.1.0", + "@typescript-eslint/utils": "8.1.0", + "@typescript-eslint/visitor-keys": "8.1.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^7.0.0", - "eslint": "^8.56.0" + "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", + "eslint": "^8.57.0 || ^9.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -1333,74 +1334,28 @@ } } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.17.0.tgz", - "integrity": "sha512-0P2jTTqyxWp9HiKLu/Vemr2Rg1Xb5B7uHItdVZ6iAenXmPo4SZ86yOPCJwMqpCyaMiEHTNqizHfsbmCFT1x9SA==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "7.17.0", - "@typescript-eslint/visitor-keys": "7.17.0" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/types": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.17.0.tgz", - "integrity": "sha512-a29Ir0EbyKTKHnZWbNsrc/gqfIBqYPwj3F2M+jWE/9bqfEHg0AMtXzkbUkOG6QgEScxh2+Pz9OXe11jHDnHR7A==", - "dev": true, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.17.0.tgz", - "integrity": "sha512-RVGC9UhPOCsfCdI9pU++K4nD7to+jTcMIbXTSOcrLqUEW6gF2pU1UUbYJKc9cvcRSK1UDeMJ7pdMxf4bhMpV/A==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "7.17.0", - "eslint-visitor-keys": "^3.4.3" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/@typescript-eslint/parser": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.17.0.tgz", - "integrity": "sha512-puiYfGeg5Ydop8eusb/Hy1k7QmOU6X3nvsqCgzrB2K4qMavK//21+PzNE8qeECgNOIoertJPUC1SpegHDI515A==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.1.0.tgz", + "integrity": "sha512-U7iTAtGgJk6DPX9wIWPPOlt1gO57097G06gIcl0N0EEnNw8RGD62c+2/DiP/zL7KrkqnnqF7gtFGR7YgzPllTA==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/scope-manager": "7.17.0", - "@typescript-eslint/types": "7.17.0", - "@typescript-eslint/typescript-estree": "7.17.0", - "@typescript-eslint/visitor-keys": "7.17.0", + "@typescript-eslint/scope-manager": "8.1.0", + "@typescript-eslint/types": "8.1.0", + "@typescript-eslint/typescript-estree": "8.1.0", + "@typescript-eslint/visitor-keys": "8.1.0", "debug": "^4.3.4" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.56.0" + "eslint": "^8.57.0 || ^9.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -1408,174 +1363,66 @@ } } }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.17.0.tgz", - "integrity": "sha512-0P2jTTqyxWp9HiKLu/Vemr2Rg1Xb5B7uHItdVZ6iAenXmPo4SZ86yOPCJwMqpCyaMiEHTNqizHfsbmCFT1x9SA==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "7.17.0", - "@typescript-eslint/visitor-keys": "7.17.0" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.17.0.tgz", - "integrity": "sha512-a29Ir0EbyKTKHnZWbNsrc/gqfIBqYPwj3F2M+jWE/9bqfEHg0AMtXzkbUkOG6QgEScxh2+Pz9OXe11jHDnHR7A==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.1.0.tgz", + "integrity": "sha512-q2/Bxa0gMOu/2/AKALI0tCKbG2zppccnRIRCW6BaaTlRVaPKft4oVYPp7WOPpcnsgbr0qROAVCVKCvIQ0tbWog==", "dev": true, + "license": "MIT", "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.17.0.tgz", - "integrity": "sha512-72I3TGq93t2GoSBWI093wmKo0n6/b7O4j9o8U+f65TVD0FS6bI2180X5eGEr8MA8PhKMvYe9myZJquUT2JkCZw==", + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.1.0.tgz", + "integrity": "sha512-DsuOZQji687sQUjm4N6c9xABJa7fjvfIdjqpSIIVOgaENf2jFXiM9hIBZOL3hb6DHK9Nvd2d7zZnoMLf9e0OtQ==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.17.0", - "@typescript-eslint/visitor-keys": "7.17.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^1.3.0" + "@typescript-eslint/types": "8.1.0", + "@typescript-eslint/visitor-keys": "8.1.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.17.0.tgz", - "integrity": "sha512-RVGC9UhPOCsfCdI9pU++K4nD7to+jTcMIbXTSOcrLqUEW6gF2pU1UUbYJKc9cvcRSK1UDeMJ7pdMxf4bhMpV/A==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "7.17.0", - "eslint-visitor-keys": "^3.4.3" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/parser/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "node_modules/@typescript-eslint/scope-manager/node_modules/@typescript-eslint/types": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.1.0.tgz", + "integrity": "sha512-q2/Bxa0gMOu/2/AKALI0tCKbG2zppccnRIRCW6BaaTlRVaPKft4oVYPp7WOPpcnsgbr0qROAVCVKCvIQ0tbWog==", "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, + "license": "MIT", "engines": { - "node": ">=16 || 14 >=14.17" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, "node_modules/@typescript-eslint/type-utils": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.17.0.tgz", - "integrity": "sha512-XD3aaBt+orgkM/7Cei0XNEm1vwUxQ958AOLALzPlbPqb8C1G8PZK85tND7Jpe69Wualri81PLU+Zc48GVKIMMA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.1.0.tgz", + "integrity": "sha512-oLYvTxljVvsMnldfl6jIKxTaU7ok7km0KDrwOt1RHYu6nxlhN3TIx8k5Q52L6wR33nOwDgM7VwW1fT1qMNfFIA==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "7.17.0", - "@typescript-eslint/utils": "7.17.0", + "@typescript-eslint/typescript-estree": "8.1.0", + "@typescript-eslint/utils": "8.1.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.56.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/types": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.17.0.tgz", - "integrity": "sha512-a29Ir0EbyKTKHnZWbNsrc/gqfIBqYPwj3F2M+jWE/9bqfEHg0AMtXzkbUkOG6QgEScxh2+Pz9OXe11jHDnHR7A==", - "dev": true, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.17.0.tgz", - "integrity": "sha512-72I3TGq93t2GoSBWI093wmKo0n6/b7O4j9o8U+f65TVD0FS6bI2180X5eGEr8MA8PhKMvYe9myZJquUT2JkCZw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "7.17.0", - "@typescript-eslint/visitor-keys": "7.17.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^1.3.0" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -1587,59 +1434,6 @@ } } }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.17.0.tgz", - "integrity": "sha512-RVGC9UhPOCsfCdI9pU++K4nD7to+jTcMIbXTSOcrLqUEW6gF2pU1UUbYJKc9cvcRSK1UDeMJ7pdMxf4bhMpV/A==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "7.17.0", - "eslint-visitor-keys": "^3.4.3" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/@typescript-eslint/types": { "version": "7.16.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.16.1.tgz", @@ -1654,66 +1448,15 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/utils": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.17.0.tgz", - "integrity": "sha512-r+JFlm5NdB+JXc7aWWZ3fKSm1gn0pkswEwIYsrGPdsT2GjsRATAKXiNtp3vgAAO1xZhX8alIOEQnNMl3kbTgJw==", + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.1.0.tgz", + "integrity": "sha512-NTHhmufocEkMiAord/g++gWKb0Fr34e9AExBRdqgWdVBaKoei2dIyYKD9Q0jBnvfbEA5zaf8plUFMUH6kQ0vGg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "7.17.0", - "@typescript-eslint/types": "7.17.0", - "@typescript-eslint/typescript-estree": "7.17.0" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.56.0" - } - }, - "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/scope-manager": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.17.0.tgz", - "integrity": "sha512-0P2jTTqyxWp9HiKLu/Vemr2Rg1Xb5B7uHItdVZ6iAenXmPo4SZ86yOPCJwMqpCyaMiEHTNqizHfsbmCFT1x9SA==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "7.17.0", - "@typescript-eslint/visitor-keys": "7.17.0" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/types": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.17.0.tgz", - "integrity": "sha512-a29Ir0EbyKTKHnZWbNsrc/gqfIBqYPwj3F2M+jWE/9bqfEHg0AMtXzkbUkOG6QgEScxh2+Pz9OXe11jHDnHR7A==", - "dev": true, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.17.0.tgz", - "integrity": "sha512-72I3TGq93t2GoSBWI093wmKo0n6/b7O4j9o8U+f65TVD0FS6bI2180X5eGEr8MA8PhKMvYe9myZJquUT2JkCZw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "7.17.0", - "@typescript-eslint/visitor-keys": "7.17.0", + "@typescript-eslint/types": "8.1.0", + "@typescript-eslint/visitor-keys": "8.1.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -1722,7 +1465,7 @@ "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -1734,37 +1477,36 @@ } } }, - "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.17.0.tgz", - "integrity": "sha512-RVGC9UhPOCsfCdI9pU++K4nD7to+jTcMIbXTSOcrLqUEW6gF2pU1UUbYJKc9cvcRSK1UDeMJ7pdMxf4bhMpV/A==", + "node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/types": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.1.0.tgz", + "integrity": "sha512-q2/Bxa0gMOu/2/AKALI0tCKbG2zppccnRIRCW6BaaTlRVaPKft4oVYPp7WOPpcnsgbr0qROAVCVKCvIQ0tbWog==", "dev": true, - "dependencies": { - "@typescript-eslint/types": "7.17.0", - "eslint-visitor-keys": "^3.4.3" - }, + "license": "MIT", "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/utils/node_modules/brace-expansion": { + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } }, - "node_modules/@typescript-eslint/utils/node_modules/minimatch": { + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -1775,11 +1517,12 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@typescript-eslint/utils/node_modules/semver": { + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -1787,6 +1530,75 @@ "node": ">=10" } }, + "node_modules/@typescript-eslint/utils": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.1.0.tgz", + "integrity": "sha512-ypRueFNKTIFwqPeJBfeIpxZ895PQhNyH4YID6js0UoBImWYoSjBsahUn9KMiJXh94uOjVBgHD9AmkyPsPnFwJA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.1.0", + "@typescript-eslint/types": "8.1.0", + "@typescript-eslint/typescript-estree": "8.1.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/types": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.1.0.tgz", + "integrity": "sha512-q2/Bxa0gMOu/2/AKALI0tCKbG2zppccnRIRCW6BaaTlRVaPKft4oVYPp7WOPpcnsgbr0qROAVCVKCvIQ0tbWog==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.1.0.tgz", + "integrity": "sha512-ba0lNI19awqZ5ZNKh6wCModMwoZs457StTebQ0q1NP58zSi2F6MOZRXwfKZy+jB78JNJ/WH8GSh2IQNzXX8Nag==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.1.0", + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/@typescript-eslint/types": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.1.0.tgz", + "integrity": "sha512-q2/Bxa0gMOu/2/AKALI0tCKbG2zppccnRIRCW6BaaTlRVaPKft4oVYPp7WOPpcnsgbr0qROAVCVKCvIQ0tbWog==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/@ungap/structured-clone": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", @@ -2434,6 +2246,7 @@ "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -3659,6 +3472,7 @@ "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "dev": true, + "license": "MIT", "dependencies": { "path-type": "^4.0.0" }, @@ -3666,15 +3480,6 @@ "node": ">=8" } }, - "node_modules/dir-glob/node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -4300,6 +4105,7 @@ "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -5044,6 +4850,7 @@ "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, + "license": "MIT", "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -6794,6 +6601,7 @@ "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 8" } @@ -7604,6 +7412,16 @@ "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", "dev": true }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/pathval": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", @@ -8412,6 +8230,7 @@ "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } diff --git a/package.json b/package.json index 38e620200..3fc0a69e1 100644 --- a/package.json +++ b/package.json @@ -107,8 +107,8 @@ "@hyperjump/json-schema": "^1.5.0", "@microsoft/api-documenter": "^7.22.4", "@microsoft/api-extractor": "^7.29.5", - "@typescript-eslint/eslint-plugin": "^7.3.1", - "@typescript-eslint/parser": "^7.16.1", + "@typescript-eslint/eslint-plugin": "^8.1.0", + "@typescript-eslint/parser": "^8.1.0", "async-done": "^2.0.0", "chai": "^5.1.1", "concurrently": "^8.0.1", diff --git a/tests/typescript/src/generators.ts b/tests/typescript/src/generators.ts index fd79a3a00..61506e11a 100644 --- a/tests/typescript/src/generators.ts +++ b/tests/typescript/src/generators.ts @@ -4,6 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ +/* eslint-disable */ + import * as Blockly from 'blockly-test/core'; import {JavascriptGenerator} from 'blockly-test/javascript'; import {PhpGenerator, phpGenerator, Order} from 'blockly-test/php'; From ec8f9c8589fd0ea849eba4ae80f59cb878a0f24a Mon Sep 17 00:00:00 2001 From: abhinavjha0239 <75026232+abhinavjha0239@users.noreply.github.com> Date: Wed, 14 Aug 2024 23:47:28 +0530 Subject: [PATCH 25/90] chore: removed the whole Drag category from the browser test (#8478) * fix: removed the whole Drag category from the blocks * fix: added comment according to reviewer * fix: added comment according to reviewer * fix: added comment according to reviewer --- tests/browser/test/toolbox_drag_test.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/browser/test/toolbox_drag_test.mjs b/tests/browser/test/toolbox_drag_test.mjs index c751f5552..47a352042 100644 --- a/tests/browser/test/toolbox_drag_test.mjs +++ b/tests/browser/test/toolbox_drag_test.mjs @@ -38,7 +38,9 @@ const testCategories = [ 'Row', 'Stack', 'Statement', - 'Drag', + // Disabled due to #8466 + // 'Drag', + // Skip fields because it's an accordion that is already open. // 'Fields', 'Defaults', From ce22f428688206089379406a5a44e309e5692ccf Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Thu, 15 Aug 2024 03:16:14 +0100 Subject: [PATCH 26/90] chore: Organise imports (#8527) * chore(deps): Add pretter-plugin-organize-imports * chore: Remove insignificant blank lines in import sections Since prettier-plugin-organize-imports sorts imports within sections separated by blank lines, but preserves the section divisions, remove any blank lines that are not dividing imports into meaningful sections. Do not remove blank lines separating side-effect-only imports from main imports. * chore: Remove unneded eslint-disable directives * chore: Organise imports --- .prettierrc.js | 2 + blocks/blocks.ts | 2 +- blocks/lists.ts | 16 +- blocks/logic.ts | 14 +- blocks/loops.ts | 16 +- blocks/math.ts | 6 +- blocks/procedures.ts | 34 +- blocks/text.ts | 22 +- blocks/variables.ts | 20 +- blocks/variables_dynamic.ts | 22 +- core/block.ts | 26 +- core/block_svg.ts | 18 +- core/blockly.ts | 329 +++++++++--------- core/blockly_options.ts | 4 +- core/bubbles.ts | 4 +- core/bubbles/bubble.ts | 6 +- core/bubbles/mini_workspace_bubble.ts | 8 +- core/bubbles/text_bubble.ts | 2 +- core/bubbles/textinput_bubble.ts | 8 +- core/clipboard.ts | 6 +- core/clipboard/block_paster.ts | 8 +- core/clipboard/workspace_comment_paster.ts | 10 +- core/comments.ts | 2 +- core/comments/comment_view.ts | 16 +- core/comments/rendered_workspace_comment.ts | 36 +- core/comments/workspace_comment.ts | 10 +- core/common.ts | 3 +- core/contextmenu.ts | 8 +- core/contextmenu_items.ts | 4 +- core/delete_area.ts | 2 +- core/dragging.ts | 4 +- core/dragging/block_drag_strategy.ts | 28 +- core/dragging/bubble_drag_strategy.ts | 6 +- core/dragging/comment_drag_strategy.ts | 10 +- core/dragging/dragger.ts | 20 +- core/dropdowndiv.ts | 2 +- core/events/events.ts | 130 +++---- core/events/events_abstract.ts | 1 - core/events/events_block_base.ts | 1 - core/events/events_block_change.ts | 3 +- core/events/events_block_create.ts | 3 +- core/events/events_block_delete.ts | 3 +- core/events/events_block_drag.ts | 2 +- .../events_block_field_intermediate_change.ts | 1 - core/events/events_block_move.ts | 3 +- core/events/events_bubble_open.ts | 4 +- core/events/events_click.ts | 3 +- core/events/events_comment_base.ts | 2 +- core/events/events_comment_change.ts | 5 +- core/events/events_comment_collapse.ts | 4 +- core/events/events_comment_create.ts | 4 +- core/events/events_comment_delete.ts | 8 +- core/events/events_comment_drag.ts | 2 +- core/events/events_comment_move.ts | 5 +- core/events/events_comment_resize.ts | 5 +- core/events/events_marker_move.ts | 1 - core/events/events_selected.ts | 3 +- core/events/events_theme_change.ts | 2 +- core/events/events_toolbox_item_select.ts | 2 +- core/events/events_trashcan_open.ts | 3 +- core/events/events_var_base.ts | 3 +- core/events/events_var_create.ts | 3 +- core/events/events_var_delete.ts | 3 +- core/events/events_var_rename.ts | 3 +- core/events/events_viewport.ts | 2 +- core/events/utils.ts | 1 - core/field.ts | 2 +- core/field_checkbox.ts | 2 +- core/field_dropdown.ts | 2 +- core/field_input.ts | 6 +- core/field_label.ts | 2 +- core/field_number.ts | 2 +- core/flyout_base.ts | 10 +- core/flyout_button.ts | 2 +- core/gesture.ts | 10 +- core/grid.ts | 6 +- core/icons.ts | 16 +- core/icons/comment_icon.ts | 24 +- core/icons/icon.ts | 2 +- core/icons/mutator_icon.ts | 14 +- core/icons/warning_icon.ts | 12 +- core/inputs.ts | 8 +- core/inputs/input.ts | 2 +- core/insertion_marker_manager.ts | 6 +- core/insertion_marker_previewer.ts | 16 +- .../i_ast_node_location_with_block.ts | 2 +- core/interfaces/i_bounded_element.ts | 3 +- core/interfaces/i_bubble.ts | 2 +- core/interfaces/i_comment_icon.ts | 4 +- core/interfaces/i_connection_checker.ts | 3 +- core/interfaces/i_drag_target.ts | 6 +- core/interfaces/i_flyout.ts | 10 +- core/interfaces/i_keyboard_accessible.ts | 3 +- core/interfaces/i_metrics_manager.ts | 7 +- core/interfaces/i_positionable.ts | 4 +- core/interfaces/i_procedure_block.ts | 3 +- core/interfaces/i_selectable_toolbox_item.ts | 2 +- core/interfaces/i_serializer.ts | 3 - core/interfaces/i_toolbox.ts | 6 +- core/keyboard_nav/ast_node.ts | 4 +- core/keyboard_nav/basic_cursor.ts | 1 - core/keyboard_nav/cursor.ts | 1 - core/keyboard_nav/marker.ts | 2 - core/keyboard_nav/tab_navigate_cursor.ts | 1 - core/layer_manager.ts | 6 +- core/observable_procedure_map.ts | 2 +- core/procedures.ts | 24 +- core/registry.ts | 16 +- core/render_management.ts | 2 +- core/renderers/common/block_rendering.ts | 73 ++-- core/renderers/common/drawer.ts | 5 +- core/renderers/common/i_path_object.ts | 4 +- core/renderers/common/info.ts | 13 +- core/renderers/common/marker_svg.ts | 3 +- core/renderers/common/path_object.ts | 1 - core/renderers/common/renderer.ts | 3 +- core/renderers/geras/drawer.ts | 1 - core/renderers/geras/highlighter.ts | 1 - core/renderers/geras/info.ts | 9 +- .../geras/measurables/inline_input.ts | 1 - .../geras/measurables/statement_input.ts | 1 - core/renderers/geras/path_object.ts | 1 - core/renderers/geras/renderer.ts | 1 - core/renderers/measurables/base.ts | 1 - core/renderers/measurables/bottom_row.ts | 1 - core/renderers/measurables/connection.ts | 2 - .../measurables/external_value_input.ts | 2 - core/renderers/measurables/field.ts | 2 - core/renderers/measurables/hat.ts | 1 - core/renderers/measurables/icon.ts | 2 - core/renderers/measurables/in_row_spacer.ts | 1 - core/renderers/measurables/inline_input.ts | 2 - .../renderers/measurables/input_connection.ts | 1 - core/renderers/measurables/input_row.ts | 1 - core/renderers/measurables/jagged_edge.ts | 1 - core/renderers/measurables/next_connection.ts | 1 - .../measurables/output_connection.ts | 1 - .../measurables/previous_connection.ts | 1 - core/renderers/measurables/round_corner.ts | 1 - core/renderers/measurables/row.ts | 1 - core/renderers/measurables/spacer_row.ts | 1 - core/renderers/measurables/square_corner.ts | 1 - core/renderers/measurables/statement_input.ts | 2 - core/renderers/measurables/top_row.ts | 1 - core/renderers/thrasos/info.ts | 1 - core/renderers/thrasos/renderer.ts | 1 - core/renderers/zelos/constants.ts | 2 +- core/renderers/zelos/drawer.ts | 1 - core/renderers/zelos/info.ts | 11 +- core/renderers/zelos/marker_svg.ts | 1 - core/renderers/zelos/measurables/inputs.ts | 1 - core/renderers/zelos/path_object.ts | 1 - core/renderers/zelos/renderer.ts | 3 +- core/serialization.ts | 8 +- core/serialization/blocks.ts | 7 +- core/serialization/procedures.ts | 2 +- core/serialization/variables.ts | 1 - core/serialization/workspace_comments.ts | 8 +- core/serialization/workspaces.ts | 1 - core/shortcut_items.ts | 8 +- core/toolbox/category.ts | 11 +- core/toolbox/collapsible_category.ts | 1 - core/toolbox/separator.ts | 1 - core/toolbox/toolbox.ts | 5 +- core/trashcan.ts | 5 +- core/utils/parsing.ts | 1 - core/utils/svg_math.ts | 1 - core/variables.ts | 2 +- core/variables_dynamic.ts | 2 +- core/widgetdiv.ts | 2 +- core/workspace.ts | 8 +- core/workspace_svg.ts | 14 +- core/xml.ts | 8 +- generators/dart/dart_generator.ts | 8 +- generators/dart/lists.ts | 4 +- generators/dart/loops.ts | 6 +- generators/dart/procedures.ts | 2 +- generators/dart/text.ts | 2 +- generators/javascript/javascript_generator.ts | 8 +- generators/javascript/lists.ts | 4 +- generators/javascript/loops.ts | 6 +- generators/javascript/procedures.ts | 2 +- generators/javascript/text.ts | 2 +- generators/lua.ts | 2 +- generators/lua/lists.ts | 4 +- generators/lua/loops.ts | 6 +- generators/lua/lua_generator.ts | 6 +- generators/lua/procedures.ts | 2 +- generators/lua/text.ts | 2 +- generators/php.ts | 2 +- generators/php/lists.ts | 6 +- generators/php/logic.ts | 2 +- generators/php/loops.ts | 6 +- generators/php/math.ts | 2 +- generators/php/php_generator.ts | 6 +- generators/php/procedures.ts | 6 +- generators/php/text.ts | 4 +- generators/php/variables.ts | 2 +- generators/python.ts | 2 +- generators/python/lists.ts | 6 +- generators/python/loops.ts | 6 +- generators/python/procedures.ts | 6 +- generators/python/python_generator.ts | 8 +- generators/python/text.ts | 6 +- package-lock.json | 22 ++ package.json | 1 + .../browser/test/basic_block_factory_test.mjs | 2 +- tests/browser/test/basic_block_test.mjs | 7 +- tests/browser/test/basic_playground_test.mjs | 8 +- tests/browser/test/block_undo_test.mjs | 6 +- tests/browser/test/delete_blocks_test.mjs | 10 +- tests/browser/test/extensive_test.mjs | 14 +- tests/browser/test/field_edits_test.mjs | 8 +- tests/browser/test/mutator_test.mjs | 12 +- tests/browser/test/procedure_test.mjs | 10 +- tests/browser/test/test_setup.mjs | 2 +- tests/browser/test/toolbox_drag_test.mjs | 8 +- tests/browser/test/workspace_comment_test.mjs | 3 +- tests/migration/validate-renamings.mjs | 5 +- tests/mocha/astnode_test.js | 2 +- tests/mocha/block_json_test.js | 2 +- tests/mocha/block_test.js | 16 +- tests/mocha/blocks/lists_test.js | 4 +- tests/mocha/blocks/logic_ternary_test.js | 2 +- tests/mocha/blocks/loops_test.js | 2 +- tests/mocha/blocks/procedures_test.js | 6 +- tests/mocha/blocks/variables_test.js | 10 +- tests/mocha/clipboard_test.js | 8 +- tests/mocha/comment_test.js | 2 +- tests/mocha/connection_checker_test.js | 2 +- tests/mocha/connection_db_test.js | 2 +- tests/mocha/connection_test.js | 10 +- tests/mocha/contextmenu_test.js | 7 +- tests/mocha/cursor_test.js | 2 +- tests/mocha/event_block_change_test.js | 2 +- tests/mocha/event_block_create_test.js | 6 +- tests/mocha/event_test.js | 6 +- tests/mocha/field_checkbox_test.js | 4 +- tests/mocha/field_colour_test.js | 10 +- tests/mocha/field_dropdown_test.js | 10 +- tests/mocha/field_image_test.js | 2 +- tests/mocha/field_label_serializable_test.js | 10 +- tests/mocha/field_label_test.js | 4 +- tests/mocha/field_number_test.js | 6 +- tests/mocha/field_registry_test.js | 3 +- tests/mocha/field_test.js | 3 +- tests/mocha/field_textinput_test.js | 10 +- tests/mocha/field_variable_test.js | 10 +- tests/mocha/flyout_test.js | 8 - tests/mocha/generator_test.js | 2 +- tests/mocha/gesture_test.js | 8 +- tests/mocha/icon_test.js | 4 +- tests/mocha/insertion_marker_manager_test.js | 8 +- tests/mocha/jso_deserialization_test.js | 13 +- tests/mocha/jso_serialization_test.js | 14 +- tests/mocha/keydown_test.js | 2 +- tests/mocha/mutator_test.js | 8 +- tests/mocha/procedure_map_test.js | 7 +- tests/mocha/registry_test.js | 2 +- tests/mocha/serializer_test.js | 2 +- tests/mocha/shortcut_registry_test.js | 2 +- tests/mocha/test_helpers/procedures.js | 2 +- tests/mocha/test_helpers/workspace.js | 4 +- tests/mocha/theme_test.js | 2 +- tests/mocha/trashcan_test.js | 12 +- tests/mocha/variable_map_test.js | 12 +- tests/mocha/workspace_comment_test.js | 8 +- tests/mocha/workspace_svg_test.js | 6 +- tests/mocha/workspace_test.js | 2 - tests/mocha/zoom_controls_test.js | 2 +- tests/node/run_node_test.mjs | 2 +- tests/typescript/src/generators.ts | 8 +- tests/typescript/src/generators/php.ts | 2 +- tests/typescript/src/generators/python.ts | 2 +- 274 files changed, 985 insertions(+), 1048 deletions(-) diff --git a/.prettierrc.js b/.prettierrc.js index bbfb46639..84a85c115 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -10,4 +10,6 @@ module.exports = { bracketSpacing: false, // Put HTML tag closing brackets on same line as last attribute. bracketSameLine: true, + // Organise imports using a plugin. + 'plugins': ['prettier-plugin-organize-imports'], }; diff --git a/blocks/blocks.ts b/blocks/blocks.ts index a9874e54d..dc6ca386c 100644 --- a/blocks/blocks.ts +++ b/blocks/blocks.ts @@ -6,6 +6,7 @@ // Former goog.module ID: Blockly.libraryBlocks +import type {BlockDefinition} from '../core/blocks.js'; import * as lists from './lists.js'; import * as logic from './logic.js'; import * as loops from './loops.js'; @@ -14,7 +15,6 @@ import * as procedures from './procedures.js'; import * as texts from './text.js'; import * as variables from './variables.js'; import * as variablesDynamic from './variables_dynamic.js'; -import type {BlockDefinition} from '../core/blocks.js'; export { lists, diff --git a/blocks/lists.ts b/blocks/lists.ts index 3b468dc9d..28ff17b3d 100644 --- a/blocks/lists.ts +++ b/blocks/lists.ts @@ -6,22 +6,22 @@ // Former goog.module ID: Blockly.libraryBlocks.lists -import * as fieldRegistry from '../core/field_registry.js'; -import * as xmlUtils from '../core/utils/xml.js'; -import {Align} from '../core/inputs/align.js'; import type {Block} from '../core/block.js'; -import type {Connection} from '../core/connection.js'; import type {BlockSvg} from '../core/block_svg.js'; -import type {FieldDropdown} from '../core/field_dropdown.js'; -import {Msg} from '../core/msg.js'; -import {MutatorIcon} from '../core/icons/mutator_icon.js'; -import type {Workspace} from '../core/workspace.js'; import { createBlockDefinitionsFromJsonArray, defineBlocks, } from '../core/common.js'; +import type {Connection} from '../core/connection.js'; import '../core/field_dropdown.js'; +import type {FieldDropdown} from '../core/field_dropdown.js'; +import * as fieldRegistry from '../core/field_registry.js'; +import {MutatorIcon} from '../core/icons/mutator_icon.js'; +import {Align} from '../core/inputs/align.js'; import {ValueInput} from '../core/inputs/value_input.js'; +import {Msg} from '../core/msg.js'; +import * as xmlUtils from '../core/utils/xml.js'; +import type {Workspace} from '../core/workspace.js'; /** * A dictionary of the block definitions provided by this module. diff --git a/blocks/logic.ts b/blocks/logic.ts index 3e5b807eb..d2a7405ff 100644 --- a/blocks/logic.ts +++ b/blocks/logic.ts @@ -6,22 +6,22 @@ // Former goog.module ID: Blockly.libraryBlocks.logic -import * as Events from '../core/events/events.js'; -import * as Extensions from '../core/extensions.js'; -import * as xmlUtils from '../core/utils/xml.js'; -import type {Abstract as AbstractEvent} from '../core/events/events_abstract.js'; import type {Block} from '../core/block.js'; import type {BlockSvg} from '../core/block_svg.js'; -import type {Connection} from '../core/connection.js'; -import {Msg} from '../core/msg.js'; -import type {Workspace} from '../core/workspace.js'; import { createBlockDefinitionsFromJsonArray, defineBlocks, } from '../core/common.js'; +import type {Connection} from '../core/connection.js'; +import * as Events from '../core/events/events.js'; +import type {Abstract as AbstractEvent} from '../core/events/events_abstract.js'; +import * as Extensions from '../core/extensions.js'; import '../core/field_dropdown.js'; import '../core/field_label.js'; import '../core/icons/mutator_icon.js'; +import {Msg} from '../core/msg.js'; +import * as xmlUtils from '../core/utils/xml.js'; +import type {Workspace} from '../core/workspace.js'; /** * A dictionary of the block definitions provided by this module. diff --git a/blocks/loops.ts b/blocks/loops.ts index c7cb710d7..dd5a81162 100644 --- a/blocks/loops.ts +++ b/blocks/loops.ts @@ -6,27 +6,27 @@ // Former goog.module ID: Blockly.libraryBlocks.loops -import type {Abstract as AbstractEvent} from '../core/events/events_abstract.js'; import type {Block} from '../core/block.js'; +import { + createBlockDefinitionsFromJsonArray, + defineBlocks, +} from '../core/common.js'; import * as ContextMenu from '../core/contextmenu.js'; import type { ContextMenuOption, LegacyContextMenuOption, } from '../core/contextmenu_registry.js'; import * as Events from '../core/events/events.js'; -import * as Extensions from '../core/extensions.js'; -import {Msg} from '../core/msg.js'; -import { - createBlockDefinitionsFromJsonArray, - defineBlocks, -} from '../core/common.js'; +import type {Abstract as AbstractEvent} from '../core/events/events_abstract.js'; import * as eventUtils from '../core/events/utils.js'; +import * as Extensions from '../core/extensions.js'; import '../core/field_dropdown.js'; import '../core/field_label.js'; import '../core/field_number.js'; import '../core/field_variable.js'; -import '../core/icons/warning_icon.js'; import {FieldVariable} from '../core/field_variable.js'; +import '../core/icons/warning_icon.js'; +import {Msg} from '../core/msg.js'; import {WorkspaceSvg} from '../core/workspace_svg.js'; /** diff --git a/blocks/math.ts b/blocks/math.ts index c96aef3c2..e5aef5fbb 100644 --- a/blocks/math.ts +++ b/blocks/math.ts @@ -6,18 +6,18 @@ // Former goog.module ID: Blockly.libraryBlocks.math -import * as Extensions from '../core/extensions.js'; -import type {FieldDropdown} from '../core/field_dropdown.js'; -import * as xmlUtils from '../core/utils/xml.js'; import type {Block} from '../core/block.js'; import { createBlockDefinitionsFromJsonArray, defineBlocks, } from '../core/common.js'; +import * as Extensions from '../core/extensions.js'; import '../core/field_dropdown.js'; +import type {FieldDropdown} from '../core/field_dropdown.js'; import '../core/field_label.js'; import '../core/field_number.js'; import '../core/field_variable.js'; +import * as xmlUtils from '../core/utils/xml.js'; /** * A dictionary of the block definitions provided by this module. diff --git a/blocks/procedures.ts b/blocks/procedures.ts index e2b7ba18f..bf9a9206b 100644 --- a/blocks/procedures.ts +++ b/blocks/procedures.ts @@ -6,40 +6,40 @@ // Former goog.module ID: Blockly.libraryBlocks.procedures -import * as ContextMenu from '../core/contextmenu.js'; -import * as Events from '../core/events/events.js'; -import * as Procedures from '../core/procedures.js'; -import * as Variables from '../core/variables.js'; -import * as Xml from '../core/xml.js'; -import * as fieldRegistry from '../core/field_registry.js'; -import * as xmlUtils from '../core/utils/xml.js'; -import type {Abstract as AbstractEvent} from '../core/events/events_abstract.js'; -import {Align} from '../core/inputs/align.js'; import type {Block} from '../core/block.js'; import type {BlockSvg} from '../core/block_svg.js'; -import type {BlockCreate} from '../core/events/events_block_create.js'; -import type {BlockChange} from '../core/events/events_block_change.js'; import type {BlockDefinition} from '../core/blocks.js'; +import * as common from '../core/common.js'; +import {defineBlocks} from '../core/common.js'; +import {config} from '../core/config.js'; import type {Connection} from '../core/connection.js'; +import * as ContextMenu from '../core/contextmenu.js'; import type { ContextMenuOption, LegacyContextMenuOption, } from '../core/contextmenu_registry.js'; +import * as Events from '../core/events/events.js'; +import type {Abstract as AbstractEvent} from '../core/events/events_abstract.js'; +import type {BlockChange} from '../core/events/events_block_change.js'; +import type {BlockCreate} from '../core/events/events_block_create.js'; import * as eventUtils from '../core/events/utils.js'; import {FieldCheckbox} from '../core/field_checkbox.js'; import {FieldLabel} from '../core/field_label.js'; +import * as fieldRegistry from '../core/field_registry.js'; import {FieldTextInput} from '../core/field_textinput.js'; -import {Msg} from '../core/msg.js'; +import '../core/icons/comment_icon.js'; import {MutatorIcon as Mutator} from '../core/icons/mutator_icon.js'; +import '../core/icons/warning_icon.js'; +import {Align} from '../core/inputs/align.js'; +import {Msg} from '../core/msg.js'; import {Names} from '../core/names.js'; +import * as Procedures from '../core/procedures.js'; +import * as xmlUtils from '../core/utils/xml.js'; import type {VariableModel} from '../core/variable_model.js'; +import * as Variables from '../core/variables.js'; import type {Workspace} from '../core/workspace.js'; import type {WorkspaceSvg} from '../core/workspace_svg.js'; -import {config} from '../core/config.js'; -import {defineBlocks} from '../core/common.js'; -import '../core/icons/comment_icon.js'; -import '../core/icons/warning_icon.js'; -import * as common from '../core/common.js'; +import * as Xml from '../core/xml.js'; /** A dictionary of the block definitions provided by this module. */ export const blocks: {[key: string]: BlockDefinition} = {}; diff --git a/blocks/text.ts b/blocks/text.ts index 450e30087..5ab631836 100644 --- a/blocks/text.ts +++ b/blocks/text.ts @@ -6,25 +6,25 @@ // Former goog.module ID: Blockly.libraryBlocks.texts -import * as Extensions from '../core/extensions.js'; -import * as fieldRegistry from '../core/field_registry.js'; -import * as xmlUtils from '../core/utils/xml.js'; -import {Align} from '../core/inputs/align.js'; import type {Block} from '../core/block.js'; import type {BlockSvg} from '../core/block_svg.js'; -import {Connection} from '../core/connection.js'; -import {FieldImage} from '../core/field_image.js'; -import {FieldDropdown} from '../core/field_dropdown.js'; -import {FieldTextInput} from '../core/field_textinput.js'; -import {Msg} from '../core/msg.js'; -import {MutatorIcon} from '../core/icons/mutator_icon.js'; -import type {Workspace} from '../core/workspace.js'; import { createBlockDefinitionsFromJsonArray, defineBlocks, } from '../core/common.js'; +import {Connection} from '../core/connection.js'; +import * as Extensions from '../core/extensions.js'; +import {FieldDropdown} from '../core/field_dropdown.js'; +import {FieldImage} from '../core/field_image.js'; +import * as fieldRegistry from '../core/field_registry.js'; +import {FieldTextInput} from '../core/field_textinput.js'; import '../core/field_variable.js'; +import {MutatorIcon} from '../core/icons/mutator_icon.js'; +import {Align} from '../core/inputs/align.js'; import {ValueInput} from '../core/inputs/value_input.js'; +import {Msg} from '../core/msg.js'; +import * as xmlUtils from '../core/utils/xml.js'; +import type {Workspace} from '../core/workspace.js'; /** * A dictionary of the block definitions provided by this module. diff --git a/blocks/variables.ts b/blocks/variables.ts index 8ac038fb2..0ec9112a3 100644 --- a/blocks/variables.ts +++ b/blocks/variables.ts @@ -6,22 +6,22 @@ // Former goog.module ID: Blockly.libraryBlocks.variables -import * as ContextMenu from '../core/contextmenu.js'; -import * as Extensions from '../core/extensions.js'; -import * as Variables from '../core/variables.js'; import type {Block} from '../core/block.js'; -import type { - ContextMenuOption, - LegacyContextMenuOption, -} from '../core/contextmenu_registry.js'; -import {FieldVariable} from '../core/field_variable.js'; -import {Msg} from '../core/msg.js'; -import type {WorkspaceSvg} from '../core/workspace_svg.js'; import { createBlockDefinitionsFromJsonArray, defineBlocks, } from '../core/common.js'; +import * as ContextMenu from '../core/contextmenu.js'; +import type { + ContextMenuOption, + LegacyContextMenuOption, +} from '../core/contextmenu_registry.js'; +import * as Extensions from '../core/extensions.js'; import '../core/field_label.js'; +import {FieldVariable} from '../core/field_variable.js'; +import {Msg} from '../core/msg.js'; +import * as Variables from '../core/variables.js'; +import type {WorkspaceSvg} from '../core/workspace_svg.js'; /** * A dictionary of the block definitions provided by this module. diff --git a/blocks/variables_dynamic.ts b/blocks/variables_dynamic.ts index e74cae423..8e4ce290e 100644 --- a/blocks/variables_dynamic.ts +++ b/blocks/variables_dynamic.ts @@ -6,23 +6,23 @@ // Former goog.module ID: Blockly.libraryBlocks.variablesDynamic -import * as ContextMenu from '../core/contextmenu.js'; -import * as Extensions from '../core/extensions.js'; -import * as Variables from '../core/variables.js'; -import {Abstract as AbstractEvent} from '../core/events/events_abstract.js'; import type {Block} from '../core/block.js'; -import type { - ContextMenuOption, - LegacyContextMenuOption, -} from '../core/contextmenu_registry.js'; -import {FieldVariable} from '../core/field_variable.js'; -import {Msg} from '../core/msg.js'; -import type {WorkspaceSvg} from '../core/workspace_svg.js'; import { createBlockDefinitionsFromJsonArray, defineBlocks, } from '../core/common.js'; +import * as ContextMenu from '../core/contextmenu.js'; +import type { + ContextMenuOption, + LegacyContextMenuOption, +} from '../core/contextmenu_registry.js'; +import {Abstract as AbstractEvent} from '../core/events/events_abstract.js'; +import * as Extensions from '../core/extensions.js'; import '../core/field_label.js'; +import {FieldVariable} from '../core/field_variable.js'; +import {Msg} from '../core/msg.js'; +import * as Variables from '../core/variables.js'; +import type {WorkspaceSvg} from '../core/workspace_svg.js'; /** * A dictionary of the block definitions provided by this module. diff --git a/core/block.ts b/core/block.ts index dad2fd6e9..7875ac6a4 100644 --- a/core/block.ts +++ b/core/block.ts @@ -23,35 +23,35 @@ import * as common from './common.js'; import {Connection} from './connection.js'; import {ConnectionType} from './connection_type.js'; import * as constants from './constants.js'; -import {DuplicateIconType} from './icons/exceptions.js'; import type {Abstract} from './events/events_abstract.js'; import type {BlockChange} from './events/events_block_change.js'; import type {BlockMove} from './events/events_block_move.js'; -import * as deprecation from './utils/deprecation.js'; import * as eventUtils from './events/utils.js'; import * as Extensions from './extensions.js'; import type {Field} from './field.js'; import * as fieldRegistry from './field_registry.js'; -import {Input} from './inputs/input.js'; -import {Align} from './inputs/align.js'; -import type {IASTNodeLocation} from './interfaces/i_ast_node_location.js'; -import {type IIcon} from './interfaces/i_icon.js'; -import {isCommentIcon} from './interfaces/i_comment_icon.js'; +import {DuplicateIconType} from './icons/exceptions.js'; +import {IconType} from './icons/icon_types.js'; import type {MutatorIcon} from './icons/mutator_icon.js'; +import {Align} from './inputs/align.js'; +import {DummyInput} from './inputs/dummy_input.js'; +import {EndRowInput} from './inputs/end_row_input.js'; +import {Input} from './inputs/input.js'; +import {StatementInput} from './inputs/statement_input.js'; +import {ValueInput} from './inputs/value_input.js'; +import type {IASTNodeLocation} from './interfaces/i_ast_node_location.js'; +import {isCommentIcon} from './interfaces/i_comment_icon.js'; +import {type IIcon} from './interfaces/i_icon.js'; +import * as registry from './registry.js'; import * as Tooltip from './tooltip.js'; import * as arrayUtils from './utils/array.js'; import {Coordinate} from './utils/coordinate.js'; +import * as deprecation from './utils/deprecation.js'; import * as idGenerator from './utils/idgenerator.js'; import * as parsing from './utils/parsing.js'; -import * as registry from './registry.js'; import {Size} from './utils/size.js'; import type {VariableModel} from './variable_model.js'; import type {Workspace} from './workspace.js'; -import {DummyInput} from './inputs/dummy_input.js'; -import {EndRowInput} from './inputs/end_row_input.js'; -import {ValueInput} from './inputs/value_input.js'; -import {StatementInput} from './inputs/statement_input.js'; -import {IconType} from './icons/icon_types.js'; /** * Class for one block. diff --git a/core/block_svg.ts b/core/block_svg.ts index 275451a61..e3a60315e 100644 --- a/core/block_svg.ts +++ b/core/block_svg.ts @@ -16,7 +16,9 @@ import './events/events_selected.js'; import {Block} from './block.js'; import * as blockAnimations from './block_animations.js'; +import {IDeletable} from './blockly.js'; import * as browserEvents from './browser_events.js'; +import {BlockCopyData, BlockPaster} from './clipboard/block_paster.js'; import * as common from './common.js'; import {config} from './config.js'; import type {Connection} from './connection.js'; @@ -28,11 +30,14 @@ import { ContextMenuRegistry, LegacyContextMenuOption, } from './contextmenu_registry.js'; +import {BlockDragStrategy} from './dragging/block_drag_strategy.js'; import type {BlockMove} from './events/events_block_move.js'; -import * as deprecation from './utils/deprecation.js'; import * as eventUtils from './events/utils.js'; import type {Field} from './field.js'; import {FieldLabel} from './field_label.js'; +import {IconType} from './icons/icon_types.js'; +import {MutatorIcon} from './icons/mutator_icon.js'; +import {WarningIcon} from './icons/warning_icon.js'; import type {Input} from './inputs/input.js'; import type {IASTNodeLocationSvg} from './interfaces/i_ast_node_location_svg.js'; import type {IBoundedElement} from './interfaces/i_bounded_element.js'; @@ -44,26 +49,21 @@ import {ASTNode} from './keyboard_nav/ast_node.js'; import {TabNavigateCursor} from './keyboard_nav/tab_navigate_cursor.js'; import {MarkerManager} from './marker_manager.js'; import {Msg} from './msg.js'; -import {MutatorIcon} from './icons/mutator_icon.js'; +import * as renderManagement from './render_management.js'; import {RenderedConnection} from './rendered_connection.js'; import type {IPathObject} from './renderers/common/i_path_object.js'; import * as blocks from './serialization/blocks.js'; import type {BlockStyle} from './theme.js'; import * as Tooltip from './tooltip.js'; import {Coordinate} from './utils/coordinate.js'; +import * as deprecation from './utils/deprecation.js'; import * as dom from './utils/dom.js'; import {Rect} from './utils/rect.js'; import {Svg} from './utils/svg.js'; import * as svgMath from './utils/svg_math.js'; -import {WarningIcon} from './icons/warning_icon.js'; +import {FlyoutItemInfo} from './utils/toolbox.js'; import type {Workspace} from './workspace.js'; import type {WorkspaceSvg} from './workspace_svg.js'; -import * as renderManagement from './render_management.js'; -import {IconType} from './icons/icon_types.js'; -import {BlockCopyData, BlockPaster} from './clipboard/block_paster.js'; -import {BlockDragStrategy} from './dragging/block_drag_strategy.js'; -import {IDeletable} from './blockly.js'; -import {FlyoutItemInfo} from './utils/toolbox.js'; /** * Class for a block's SVG representation. diff --git a/core/blockly.ts b/core/blockly.ts index 77362c0b4..01490dbb6 100644 --- a/core/blockly.ts +++ b/core/blockly.ts @@ -22,8 +22,10 @@ import {BlocklyOptions} from './blockly_options.js'; import {Blocks} from './blocks.js'; import * as browserEvents from './browser_events.js'; import * as bubbles from './bubbles.js'; +import {MiniWorkspaceBubble} from './bubbles/mini_workspace_bubble.js'; import * as bumpObjects from './bump_objects.js'; import * as clipboard from './clipboard.js'; +import * as comments from './comments.js'; import * as common from './common.js'; import {ComponentManager} from './component_manager.js'; import {config} from './config.js'; @@ -31,15 +33,15 @@ import {Connection} from './connection.js'; import {ConnectionChecker} from './connection_checker.js'; import {ConnectionDB} from './connection_db.js'; import {ConnectionType} from './connection_type.js'; +import * as constants from './constants.js'; import * as ContextMenu from './contextmenu.js'; import * as ContextMenuItems from './contextmenu_items.js'; import {ContextMenuRegistry} from './contextmenu_registry.js'; -import * as comments from './comments.js'; import * as Css from './css.js'; import {DeleteArea} from './delete_area.js'; import * as dialog from './dialog.js'; -import * as dragging from './dragging.js'; import {DragTarget} from './drag_target.js'; +import * as dragging from './dragging.js'; import * as dropDownDiv from './dropdowndiv.js'; import * as Events from './events/events.js'; import * as Extensions from './extensions.js'; @@ -104,8 +106,8 @@ import {Gesture} from './gesture.js'; import {Grid} from './grid.js'; import * as icons from './icons.js'; import {inject} from './inject.js'; -import {Input} from './inputs/input.js'; import * as inputs from './inputs.js'; +import {Input} from './inputs/input.js'; import {InsertionMarkerManager} from './insertion_marker_manager.js'; import {InsertionMarkerPreviewer} from './insertion_marker_previewer.js'; import {IASTNodeLocation} from './interfaces/i_ast_node_location.js'; @@ -119,16 +121,16 @@ import {IComponent} from './interfaces/i_component.js'; import {IConnectionChecker} from './interfaces/i_connection_checker.js'; import {IConnectionPreviewer} from './interfaces/i_connection_previewer.js'; import {IContextMenu} from './interfaces/i_contextmenu.js'; -import {ICopyable, isCopyable, ICopyData} from './interfaces/i_copyable.js'; +import {ICopyData, ICopyable, isCopyable} from './interfaces/i_copyable.js'; import {IDeletable, isDeletable} from './interfaces/i_deletable.js'; import {IDeleteArea} from './interfaces/i_delete_area.js'; import {IDragTarget} from './interfaces/i_drag_target.js'; -import {IDragger} from './interfaces/i_dragger.js'; import { + IDragStrategy, IDraggable, isDraggable, - IDragStrategy, } from './interfaces/i_draggable.js'; +import {IDragger} from './interfaces/i_dragger.js'; import {IFlyout} from './interfaces/i_flyout.js'; import {IHasBubble, hasBubble} from './interfaces/i_has_bubble.js'; import {IIcon, isIcon} from './interfaces/i_icon.js'; @@ -159,23 +161,21 @@ import {BasicCursor} from './keyboard_nav/basic_cursor.js'; import {Cursor} from './keyboard_nav/cursor.js'; import {Marker} from './keyboard_nav/marker.js'; import {TabNavigateCursor} from './keyboard_nav/tab_navigate_cursor.js'; -import {MarkerManager} from './marker_manager.js'; import type {LayerManager} from './layer_manager.js'; import * as layers from './layers.js'; +import {MarkerManager} from './marker_manager.js'; import {Menu} from './menu.js'; import {MenuItem} from './menuitem.js'; import {MetricsManager} from './metrics_manager.js'; import {Msg, setLocale} from './msg.js'; -import {MiniWorkspaceBubble} from './bubbles/mini_workspace_bubble.js'; import {Names} from './names.js'; import {Options} from './options.js'; import * as uiPosition from './positionable_helpers.js'; import * as Procedures from './procedures.js'; import * as registry from './registry.js'; -import {RenderedConnection} from './rendered_connection.js'; import * as renderManagement from './render_management.js'; +import {RenderedConnection} from './rendered_connection.js'; import * as blockRendering from './renderers/common/block_rendering.js'; -import * as constants from './constants.js'; import * as geras from './renderers/geras/geras.js'; import * as thrasos from './renderers/thrasos/thrasos.js'; import * as zelos from './renderers/zelos/zelos.js'; @@ -418,172 +418,187 @@ Names.prototype.populateProcedures = function ( // clang-format on // Re-export submodules that no longer declareLegacyNamespace. -export {browserEvents}; -export {ContextMenu}; -export {ContextMenuItems}; -export {Css}; -export {Events}; -export {Extensions}; -export {Procedures}; -export {Procedures as procedures}; -export {ShortcutItems}; -export {Themes}; -export {Tooltip}; -export {Touch}; -export {Variables}; -export {VariablesDynamic}; -export {WidgetDiv}; -export {Xml}; -export {blockAnimations}; -export {blockRendering}; -export {bumpObjects}; -export {clipboard}; -export {common}; -export {constants}; -export {dialog}; -export {fieldRegistry}; -export {geras}; -export {registry}; -export {thrasos}; -export {uiPosition}; -export {utils}; -export {zelos}; -export {ASTNode}; -export {BasicCursor}; -export {Block}; -export {BlocklyOptions}; -export {BlockSvg}; -export {Blocks}; -export {bubbles}; -export {CollapsibleToolboxCategory}; -export {ComponentManager}; -export {Connection}; -export {ConnectionType}; -export {ConnectionChecker}; -export {ConnectionDB}; -export {ContextMenuRegistry}; -export {comments}; -export {Cursor}; -export {DeleteArea}; -export {dragging}; -export {DragTarget}; -export const DropDownDiv = dropDownDiv; -export {Field, FieldConfig, FieldValidator, UnattachedFieldError}; export { + ASTNode, + BasicCursor, + Block, + BlockSvg, + BlocklyOptions, + Blocks, + CollapsibleToolboxCategory, + ComponentManager, + Connection, + ConnectionChecker, + ConnectionDB, + ConnectionType, + ContextMenu, + ContextMenuItems, + ContextMenuRegistry, + Css, + Cursor, + DeleteArea, + DragTarget, + Events, + Extensions, + Procedures, + ShortcutItems, + Themes, + Tooltip, + Touch, + Variables, + VariablesDynamic, + WidgetDiv, + Xml, + blockAnimations, + blockRendering, + browserEvents, + bubbles, + bumpObjects, + clipboard, + comments, + common, + constants, + dialog, + dragging, + fieldRegistry, + geras, + Procedures as procedures, + registry, + thrasos, + uiPosition, + utils, + zelos, +}; +export const DropDownDiv = dropDownDiv; +export { + CodeGenerator, + Field, FieldCheckbox, FieldCheckboxConfig, FieldCheckboxFromJsonConfig, FieldCheckboxValidator, -}; -export { + FieldConfig, FieldDropdown, FieldDropdownConfig, FieldDropdownFromJsonConfig, FieldDropdownValidator, - MenuGenerator, - MenuGeneratorFunction, - MenuOption, -}; -export {FieldImage, FieldImageConfig, FieldImageFromJsonConfig}; -export {FieldLabel, FieldLabelConfig, FieldLabelFromJsonConfig}; -export {FieldLabelSerializable}; -export { + FieldImage, + FieldImageConfig, + FieldImageFromJsonConfig, + FieldLabel, + FieldLabelConfig, + FieldLabelFromJsonConfig, + FieldLabelSerializable, FieldNumber, FieldNumberConfig, FieldNumberFromJsonConfig, FieldNumberValidator, -}; -export { FieldTextInput, FieldTextInputConfig, FieldTextInputFromJsonConfig, FieldTextInputValidator, -}; -export { + FieldValidator, FieldVariable, FieldVariableConfig, FieldVariableFromJsonConfig, FieldVariableValidator, + Flyout, + FlyoutButton, + FlyoutMetricsManager, + CodeGenerator as Generator, + Gesture, + Grid, + HorizontalFlyout, + IASTNodeLocation, + IASTNodeLocationSvg, + IASTNodeLocationWithBlock, + IAutoHideable, + IBoundedElement, + IBubble, + ICollapsibleToolboxItem, + IComponent, + IConnectionChecker, + IConnectionPreviewer, + IContextMenu, + ICopyData, + ICopyable, + IDeletable, + IDeleteArea, + IDragStrategy, + IDragTarget, + IDraggable, + IDragger, + IFlyout, + IHasBubble, + IIcon, + IKeyboardAccessible, + IMetricsManager, + IMovable, + IObservable, + IPaster, + IPositionable, + IRegistrable, + IRenderedElement, + ISelectable, + ISelectableToolboxItem, + ISerializable, + IStyleable, + IToolbox, + IToolboxItem, + IVariableBackedParameterModel, + Input, + InsertionMarkerManager, + InsertionMarkerPreviewer, + LayerManager, + Marker, + MarkerManager, + Menu, + MenuGenerator, + MenuGeneratorFunction, + MenuItem, + MenuOption, + MetricsManager, + Msg, + Names, + Options, + RenderedConnection, + Scrollbar, + ScrollbarPair, + ShortcutRegistry, + TabNavigateCursor, + Theme, + ThemeManager, + Toolbox, + ToolboxCategory, + ToolboxItem, + ToolboxSeparator, + Trashcan, + UnattachedFieldError, + VariableMap, + VariableModel, + VerticalFlyout, + Workspace, + WorkspaceAudio, + WorkspaceDragger, + WorkspaceSvg, + ZoomControls, + config, + hasBubble, + icons, + inject, + inputs, + isCopyable, + isDeletable, + isDraggable, + isIcon, + isObservable, + isPaster, + isRenderedElement, + isSelectable, + isSerializable, + isVariableBackedParameterModel, + layers, + renderManagement, + serialization, + setLocale, }; -export {Flyout}; -export {FlyoutButton}; -export {FlyoutMetricsManager}; -export {CodeGenerator}; -export {CodeGenerator as Generator}; // Deprecated name, October 2022. -export {Gesture}; -export {Grid}; -export {HorizontalFlyout}; -export {IASTNodeLocation}; -export {IASTNodeLocationSvg}; -export {IASTNodeLocationWithBlock}; -export {IAutoHideable}; -export {IBoundedElement}; -export {IBubble}; -export {ICollapsibleToolboxItem}; -export {IComponent}; -export {IConnectionChecker}; -export {IConnectionPreviewer}; -export {IContextMenu}; -export {icons}; -export {ICopyable, isCopyable, ICopyData}; -export {IDeletable, isDeletable}; -export {IDeleteArea}; -export {IDragTarget}; -export {IDragger}; -export {IDraggable, isDraggable, IDragStrategy}; -export {IFlyout}; -export {IHasBubble, hasBubble}; -export {IIcon, isIcon}; -export {IKeyboardAccessible}; -export {IMetricsManager}; -export {IMovable}; -export {Input}; -export {inputs}; -export {InsertionMarkerManager}; -export {InsertionMarkerPreviewer}; -export {IObservable, isObservable}; -export {IPaster, isPaster}; -export {IPositionable}; -export {IRegistrable}; -export {IRenderedElement, isRenderedElement}; -export {ISelectable, isSelectable}; -export {ISelectableToolboxItem}; -export {ISerializable, isSerializable}; -export {IStyleable}; -export {IToolbox}; -export {IToolboxItem}; -export {IVariableBackedParameterModel, isVariableBackedParameterModel}; -export {Marker}; -export {MarkerManager}; -export {LayerManager}; -export {Menu}; -export {MenuItem}; -export {MetricsManager}; -export {Msg, setLocale}; -export {Names}; -export {Options}; -export {RenderedConnection}; -export {renderManagement}; -export {Scrollbar}; -export {ScrollbarPair}; -export {ShortcutRegistry}; -export {TabNavigateCursor}; -export {Theme}; -export {ThemeManager}; -export {Toolbox}; -export {ToolboxCategory}; -export {ToolboxItem}; -export {ToolboxSeparator}; -export {Trashcan}; -export {VariableMap}; -export {VariableModel}; -export {VerticalFlyout}; -export {Workspace}; -export {WorkspaceAudio}; -export {WorkspaceDragger}; -export {WorkspaceSvg}; -export {ZoomControls}; -export {config}; -export {inject}; -export {serialization}; -export {layers}; diff --git a/core/blockly_options.ts b/core/blockly_options.ts index e3ed0b912..dd18dbfee 100644 --- a/core/blockly_options.ts +++ b/core/blockly_options.ts @@ -6,9 +6,9 @@ // Former goog.module ID: Blockly.BlocklyOptions -import type {Theme, ITheme} from './theme.js'; -import type {WorkspaceSvg} from './workspace_svg.js'; +import type {ITheme, Theme} from './theme.js'; import type {ToolboxDefinition} from './utils/toolbox.js'; +import type {WorkspaceSvg} from './workspace_svg.js'; /** * Blockly options. diff --git a/core/bubbles.ts b/core/bubbles.ts index 0c61741f9..a49c2ae35 100644 --- a/core/bubbles.ts +++ b/core/bubbles.ts @@ -5,8 +5,8 @@ */ import {Bubble} from './bubbles/bubble.js'; +import {MiniWorkspaceBubble} from './bubbles/mini_workspace_bubble.js'; import {TextBubble} from './bubbles/text_bubble.js'; import {TextInputBubble} from './bubbles/textinput_bubble.js'; -import {MiniWorkspaceBubble} from './bubbles/mini_workspace_bubble.js'; -export {Bubble, TextBubble, TextInputBubble, MiniWorkspaceBubble}; +export {Bubble, MiniWorkspaceBubble, TextBubble, TextInputBubble}; diff --git a/core/bubbles/bubble.ts b/core/bubbles/bubble.ts index e86f5a856..bac94dbc8 100644 --- a/core/bubbles/bubble.ts +++ b/core/bubbles/bubble.ts @@ -4,21 +4,21 @@ * SPDX-License-Identifier: Apache-2.0 */ +import {ISelectable} from '../blockly.js'; import * as browserEvents from '../browser_events.js'; +import * as common from '../common.js'; import {BubbleDragStrategy} from '../dragging/bubble_drag_strategy.js'; import {IBubble} from '../interfaces/i_bubble.js'; import {ContainerRegion} from '../metrics_manager.js'; import {Scrollbar} from '../scrollbar.js'; import {Coordinate} from '../utils/coordinate.js'; import * as dom from '../utils/dom.js'; +import * as idGenerator from '../utils/idgenerator.js'; import * as math from '../utils/math.js'; import {Rect} from '../utils/rect.js'; import {Size} from '../utils/size.js'; import {Svg} from '../utils/svg.js'; import {WorkspaceSvg} from '../workspace_svg.js'; -import * as common from '../common.js'; -import {ISelectable} from '../blockly.js'; -import * as idGenerator from '../utils/idgenerator.js'; /** * The abstract pop-up bubble class. This creates a UI that looks like a speech diff --git a/core/bubbles/mini_workspace_bubble.ts b/core/bubbles/mini_workspace_bubble.ts index 74317d57b..f4ad96c8c 100644 --- a/core/bubbles/mini_workspace_bubble.ts +++ b/core/bubbles/mini_workspace_bubble.ts @@ -4,16 +4,16 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {Abstract as AbstractEvent} from '../events/events_abstract.js'; import type {BlocklyOptions} from '../blockly_options.js'; -import {Bubble} from './bubble.js'; +import {Abstract as AbstractEvent} from '../events/events_abstract.js'; +import {Options} from '../options.js'; import {Coordinate} from '../utils/coordinate.js'; import * as dom from '../utils/dom.js'; -import {Options} from '../options.js'; -import {Svg} from '../utils/svg.js'; import type {Rect} from '../utils/rect.js'; import {Size} from '../utils/size.js'; +import {Svg} from '../utils/svg.js'; import type {WorkspaceSvg} from '../workspace_svg.js'; +import {Bubble} from './bubble.js'; /** * A bubble that contains a mini-workspace which can hold arbitrary blocks. diff --git a/core/bubbles/text_bubble.ts b/core/bubbles/text_bubble.ts index 020ab4f2e..7ac5fa029 100644 --- a/core/bubbles/text_bubble.ts +++ b/core/bubbles/text_bubble.ts @@ -4,13 +4,13 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {Bubble} from './bubble.js'; import {Coordinate} from '../utils/coordinate.js'; import * as dom from '../utils/dom.js'; import {Rect} from '../utils/rect.js'; import {Size} from '../utils/size.js'; import {Svg} from '../utils/svg.js'; import {WorkspaceSvg} from '../workspace_svg.js'; +import {Bubble} from './bubble.js'; /** * A bubble that displays non-editable text. Used by the warning icon. diff --git a/core/bubbles/textinput_bubble.ts b/core/bubbles/textinput_bubble.ts index d7d1f5ae7..675dbb539 100644 --- a/core/bubbles/textinput_bubble.ts +++ b/core/bubbles/textinput_bubble.ts @@ -4,16 +4,16 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {Bubble} from './bubble.js'; -import {Coordinate} from '../utils/coordinate.js'; import * as Css from '../css.js'; +import * as touch from '../touch.js'; +import {browserEvents} from '../utils.js'; +import {Coordinate} from '../utils/coordinate.js'; import * as dom from '../utils/dom.js'; import {Rect} from '../utils/rect.js'; import {Size} from '../utils/size.js'; import {Svg} from '../utils/svg.js'; -import * as touch from '../touch.js'; import {WorkspaceSvg} from '../workspace_svg.js'; -import {browserEvents} from '../utils.js'; +import {Bubble} from './bubble.js'; /** * A bubble that displays editable text. It can also be resized by the user. diff --git a/core/clipboard.ts b/core/clipboard.ts index ed574d112..62e23fd24 100644 --- a/core/clipboard.ts +++ b/core/clipboard.ts @@ -6,12 +6,12 @@ // Former goog.module ID: Blockly.clipboard -import type {ICopyData, ICopyable} from './interfaces/i_copyable.js'; import {BlockPaster} from './clipboard/block_paster.js'; -import * as globalRegistry from './registry.js'; -import {WorkspaceSvg} from './workspace_svg.js'; import * as registry from './clipboard/registry.js'; +import type {ICopyData, ICopyable} from './interfaces/i_copyable.js'; +import * as globalRegistry from './registry.js'; import {Coordinate} from './utils/coordinate.js'; +import {WorkspaceSvg} from './workspace_svg.js'; /** Metadata about the object that is currently on the clipboard. */ let stashedCopyData: ICopyData | null = null; diff --git a/core/clipboard/block_paster.ts b/core/clipboard/block_paster.ts index f82adf2b3..04c55c5b0 100644 --- a/core/clipboard/block_paster.ts +++ b/core/clipboard/block_paster.ts @@ -5,15 +5,15 @@ */ import {BlockSvg} from '../block_svg.js'; -import * as registry from './registry.js'; +import * as common from '../common.js'; +import {config} from '../config.js'; +import * as eventUtils from '../events/utils.js'; import {ICopyData} from '../interfaces/i_copyable.js'; import {IPaster} from '../interfaces/i_paster.js'; import {State, append} from '../serialization/blocks.js'; import {Coordinate} from '../utils/coordinate.js'; import {WorkspaceSvg} from '../workspace_svg.js'; -import * as eventUtils from '../events/utils.js'; -import {config} from '../config.js'; -import * as common from '../common.js'; +import * as registry from './registry.js'; export class BlockPaster implements IPaster { static TYPE = 'block'; diff --git a/core/clipboard/workspace_comment_paster.ts b/core/clipboard/workspace_comment_paster.ts index c7e5eed68..173949a2b 100644 --- a/core/clipboard/workspace_comment_paster.ts +++ b/core/clipboard/workspace_comment_paster.ts @@ -4,15 +4,15 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {IPaster} from '../interfaces/i_paster.js'; +import {RenderedWorkspaceComment} from '../comments/rendered_workspace_comment.js'; +import * as common from '../common.js'; +import * as eventUtils from '../events/utils.js'; import {ICopyData} from '../interfaces/i_copyable.js'; +import {IPaster} from '../interfaces/i_paster.js'; +import * as commentSerialiation from '../serialization/workspace_comments.js'; import {Coordinate} from '../utils/coordinate.js'; import {WorkspaceSvg} from '../workspace_svg.js'; import * as registry from './registry.js'; -import * as commentSerialiation from '../serialization/workspace_comments.js'; -import * as eventUtils from '../events/utils.js'; -import * as common from '../common.js'; -import {RenderedWorkspaceComment} from '../comments/rendered_workspace_comment.js'; export class WorkspaceCommentPaster implements IPaster diff --git a/core/comments.ts b/core/comments.ts index 368db0e77..ee8591987 100644 --- a/core/comments.ts +++ b/core/comments.ts @@ -5,5 +5,5 @@ */ export {CommentView} from './comments/comment_view.js'; -export {WorkspaceComment} from './comments/workspace_comment.js'; export {RenderedWorkspaceComment} from './comments/rendered_workspace_comment.js'; +export {WorkspaceComment} from './comments/workspace_comment.js'; diff --git a/core/comments/comment_view.ts b/core/comments/comment_view.ts index bda2b9762..bf615163c 100644 --- a/core/comments/comment_view.ts +++ b/core/comments/comment_view.ts @@ -4,16 +4,16 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {IRenderedElement} from '../interfaces/i_rendered_element.js'; -import {WorkspaceSvg} from '../workspace_svg.js'; -import * as dom from '../utils/dom.js'; -import {Svg} from '../utils/svg.js'; -import * as layers from '../layers.js'; -import * as css from '../css.js'; -import {Coordinate} from '../utils/coordinate.js'; -import {Size} from '../utils/size.js'; import * as browserEvents from '../browser_events.js'; +import * as css from '../css.js'; +import {IRenderedElement} from '../interfaces/i_rendered_element.js'; +import * as layers from '../layers.js'; import * as touch from '../touch.js'; +import {Coordinate} from '../utils/coordinate.js'; +import * as dom from '../utils/dom.js'; +import {Size} from '../utils/size.js'; +import {Svg} from '../utils/svg.js'; +import {WorkspaceSvg} from '../workspace_svg.js'; export class CommentView implements IRenderedElement { /** The root group element of the comment view. */ diff --git a/core/comments/rendered_workspace_comment.ts b/core/comments/rendered_workspace_comment.ts index 7cc643808..ff2133574 100644 --- a/core/comments/rendered_workspace_comment.ts +++ b/core/comments/rendered_workspace_comment.ts @@ -4,31 +4,31 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {WorkspaceComment} from './workspace_comment.js'; -import {WorkspaceSvg} from '../workspace_svg.js'; -import {CommentView} from './comment_view.js'; -import {Coordinate} from '../utils/coordinate.js'; -import {Rect} from '../utils/rect.js'; -import {Size} from '../utils/size.js'; -import {IBoundedElement} from '../interfaces/i_bounded_element.js'; -import {IRenderedElement} from '../interfaces/i_rendered_element.js'; -import * as dom from '../utils/dom.js'; -import {IDraggable} from '../interfaces/i_draggable.js'; -import {CommentDragStrategy} from '../dragging/comment_drag_strategy.js'; import * as browserEvents from '../browser_events.js'; -import * as common from '../common.js'; -import {ISelectable} from '../interfaces/i_selectable.js'; -import {IDeletable} from '../interfaces/i_deletable.js'; -import {ICopyable} from '../interfaces/i_copyable.js'; -import * as commentSerialization from '../serialization/workspace_comments.js'; import { - WorkspaceCommentPaster, WorkspaceCommentCopyData, + WorkspaceCommentPaster, } from '../clipboard/workspace_comment_paster.js'; -import {IContextMenu} from '../interfaces/i_contextmenu.js'; +import * as common from '../common.js'; import * as contextMenu from '../contextmenu.js'; import {ContextMenuRegistry} from '../contextmenu_registry.js'; +import {CommentDragStrategy} from '../dragging/comment_drag_strategy.js'; +import {IBoundedElement} from '../interfaces/i_bounded_element.js'; +import {IContextMenu} from '../interfaces/i_contextmenu.js'; +import {ICopyable} from '../interfaces/i_copyable.js'; +import {IDeletable} from '../interfaces/i_deletable.js'; +import {IDraggable} from '../interfaces/i_draggable.js'; +import {IRenderedElement} from '../interfaces/i_rendered_element.js'; +import {ISelectable} from '../interfaces/i_selectable.js'; import * as layers from '../layers.js'; +import * as commentSerialization from '../serialization/workspace_comments.js'; +import {Coordinate} from '../utils/coordinate.js'; +import * as dom from '../utils/dom.js'; +import {Rect} from '../utils/rect.js'; +import {Size} from '../utils/size.js'; +import {WorkspaceSvg} from '../workspace_svg.js'; +import {CommentView} from './comment_view.js'; +import {WorkspaceComment} from './workspace_comment.js'; export class RenderedWorkspaceComment extends WorkspaceComment diff --git a/core/comments/workspace_comment.ts b/core/comments/workspace_comment.ts index 0764b5168..a659bc8d9 100644 --- a/core/comments/workspace_comment.ts +++ b/core/comments/workspace_comment.ts @@ -4,13 +4,13 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {Workspace} from '../workspace.js'; -import {Size} from '../utils/size.js'; -import {Coordinate} from '../utils/coordinate.js'; -import * as idGenerator from '../utils/idgenerator.js'; -import * as eventUtils from '../events/utils.js'; import {CommentMove} from '../events/events_comment_move.js'; import {CommentResize} from '../events/events_comment_resize.js'; +import * as eventUtils from '../events/utils.js'; +import {Coordinate} from '../utils/coordinate.js'; +import * as idGenerator from '../utils/idgenerator.js'; +import {Size} from '../utils/size.js'; +import {Workspace} from '../workspace.js'; export class WorkspaceComment { /** The unique identifier for this comment. */ diff --git a/core/common.ts b/core/common.ts index fba960a5b..fcd27b00d 100644 --- a/core/common.ts +++ b/core/common.ts @@ -6,14 +6,13 @@ // Former goog.module ID: Blockly.common -/* eslint-disable-next-line no-unused-vars */ import type {Block} from './block.js'; import {ISelectable} from './blockly.js'; import {BlockDefinition, Blocks} from './blocks.js'; import type {Connection} from './connection.js'; +import * as eventUtils from './events/utils.js'; import type {Workspace} from './workspace.js'; import type {WorkspaceSvg} from './workspace_svg.js'; -import * as eventUtils from './events/utils.js'; /** Database of all workspaces. */ const WorkspaceDB_ = Object.create(null); diff --git a/core/contextmenu.ts b/core/contextmenu.ts index e469c4335..8f4626358 100644 --- a/core/contextmenu.ts +++ b/core/contextmenu.ts @@ -9,8 +9,8 @@ import type {Block} from './block.js'; import type {BlockSvg} from './block_svg.js'; import * as browserEvents from './browser_events.js'; +import * as common from './common.js'; import {config} from './config.js'; -import * as dom from './utils/dom.js'; import type { ContextMenuOption, LegacyContextMenuOption, @@ -18,14 +18,14 @@ import type { import * as eventUtils from './events/utils.js'; import {Menu} from './menu.js'; import {MenuItem} from './menuitem.js'; -import * as aria from './utils/aria.js'; -import {Rect} from './utils/rect.js'; import * as serializationBlocks from './serialization/blocks.js'; +import * as aria from './utils/aria.js'; +import * as dom from './utils/dom.js'; +import {Rect} from './utils/rect.js'; import * as svgMath from './utils/svg_math.js'; import * as WidgetDiv from './widgetdiv.js'; import type {WorkspaceSvg} from './workspace_svg.js'; import * as Xml from './xml.js'; -import * as common from './common.js'; /** * Which block is the context menu attached to? diff --git a/core/contextmenu_items.ts b/core/contextmenu_items.ts index 254906ce7..25ffab59b 100644 --- a/core/contextmenu_items.ts +++ b/core/contextmenu_items.ts @@ -9,12 +9,13 @@ import type {BlockSvg} from './block_svg.js'; import * as clipboard from './clipboard.js'; import {RenderedWorkspaceComment} from './comments/rendered_workspace_comment.js'; +import * as common from './common.js'; +import {MANUALLY_DISABLED} from './constants.js'; import { ContextMenuRegistry, RegistryItem, Scope, } from './contextmenu_registry.js'; -import {MANUALLY_DISABLED} from './constants.js'; import * as dialog from './dialog.js'; import * as Events from './events/events.js'; import * as eventUtils from './events/utils.js'; @@ -23,7 +24,6 @@ import {Msg} from './msg.js'; import {StatementInput} from './renderers/zelos/zelos.js'; import {Coordinate} from './utils/coordinate.js'; import type {WorkspaceSvg} from './workspace_svg.js'; -import * as common from './common.js'; /** * Option to undo previous action. diff --git a/core/delete_area.ts b/core/delete_area.ts index 4967927c4..405084db9 100644 --- a/core/delete_area.ts +++ b/core/delete_area.ts @@ -14,9 +14,9 @@ import {BlockSvg} from './block_svg.js'; import {DragTarget} from './drag_target.js'; +import {isDeletable} from './interfaces/i_deletable.js'; import type {IDeleteArea} from './interfaces/i_delete_area.js'; import type {IDraggable} from './interfaces/i_draggable.js'; -import {isDeletable} from './interfaces/i_deletable.js'; /** * Abstract class for a component that can delete a block or bubble that is diff --git a/core/dragging.ts b/core/dragging.ts index a7e46fc27..4ba85c49f 100644 --- a/core/dragging.ts +++ b/core/dragging.ts @@ -4,9 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {Dragger} from './dragging/dragger.js'; import {BlockDragStrategy} from './dragging/block_drag_strategy.js'; import {BubbleDragStrategy} from './dragging/bubble_drag_strategy.js'; import {CommentDragStrategy} from './dragging/comment_drag_strategy.js'; +import {Dragger} from './dragging/dragger.js'; -export {Dragger, BlockDragStrategy, BubbleDragStrategy, CommentDragStrategy}; +export {BlockDragStrategy, BubbleDragStrategy, CommentDragStrategy, Dragger}; diff --git a/core/dragging/block_drag_strategy.ts b/core/dragging/block_drag_strategy.ts index 2afdba51f..968de3902 100644 --- a/core/dragging/block_drag_strategy.ts +++ b/core/dragging/block_drag_strategy.ts @@ -4,24 +4,24 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {WorkspaceSvg} from '../workspace_svg.js'; -import {IDragStrategy} from '../interfaces/i_draggable.js'; -import {Coordinate} from '../utils.js'; -import * as eventUtils from '../events/utils.js'; -import {BlockSvg} from '../block_svg.js'; -import {RenderedConnection} from '../rendered_connection.js'; -import * as dom from '../utils/dom.js'; -import * as blockAnimation from '../block_animations.js'; -import {ConnectionType} from '../connection_type.js'; -import * as bumpObjects from '../bump_objects.js'; -import * as registry from '../registry.js'; -import {IConnectionPreviewer} from '../interfaces/i_connection_previewer.js'; -import {Connection} from '../connection.js'; import type {Block} from '../block.js'; +import * as blockAnimation from '../block_animations.js'; +import {BlockSvg} from '../block_svg.js'; +import * as bumpObjects from '../bump_objects.js'; import {config} from '../config.js'; +import {Connection} from '../connection.js'; +import {ConnectionType} from '../connection_type.js'; import type {BlockMove} from '../events/events_block_move.js'; -import {finishQueuedRenders} from '../render_management.js'; +import * as eventUtils from '../events/utils.js'; +import {IConnectionPreviewer} from '../interfaces/i_connection_previewer.js'; +import {IDragStrategy} from '../interfaces/i_draggable.js'; import * as layers from '../layers.js'; +import * as registry from '../registry.js'; +import {finishQueuedRenders} from '../render_management.js'; +import {RenderedConnection} from '../rendered_connection.js'; +import {Coordinate} from '../utils.js'; +import * as dom from '../utils/dom.js'; +import {WorkspaceSvg} from '../workspace_svg.js'; /** Represents a nearby valid connection. */ interface ConnectionCandidate { diff --git a/core/dragging/bubble_drag_strategy.ts b/core/dragging/bubble_drag_strategy.ts index 05465a804..c2a5c58f4 100644 --- a/core/dragging/bubble_drag_strategy.ts +++ b/core/dragging/bubble_drag_strategy.ts @@ -4,11 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {IDragStrategy} from '../interfaces/i_draggable.js'; -import {Coordinate} from '../utils.js'; -import * as eventUtils from '../events/utils.js'; import {IBubble, WorkspaceSvg} from '../blockly.js'; +import * as eventUtils from '../events/utils.js'; +import {IDragStrategy} from '../interfaces/i_draggable.js'; import * as layers from '../layers.js'; +import {Coordinate} from '../utils.js'; export class BubbleDragStrategy implements IDragStrategy { private startLoc: Coordinate | null = null; diff --git a/core/dragging/comment_drag_strategy.ts b/core/dragging/comment_drag_strategy.ts index 2197d37f2..4053638c2 100644 --- a/core/dragging/comment_drag_strategy.ts +++ b/core/dragging/comment_drag_strategy.ts @@ -4,13 +4,13 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {IDragStrategy} from '../interfaces/i_draggable.js'; -import {Coordinate} from '../utils.js'; -import * as eventUtils from '../events/utils.js'; -import * as layers from '../layers.js'; import {RenderedWorkspaceComment} from '../comments.js'; -import {WorkspaceSvg} from '../workspace_svg.js'; import {CommentMove} from '../events/events_comment_move.js'; +import * as eventUtils from '../events/utils.js'; +import {IDragStrategy} from '../interfaces/i_draggable.js'; +import * as layers from '../layers.js'; +import {Coordinate} from '../utils.js'; +import {WorkspaceSvg} from '../workspace_svg.js'; export class CommentDragStrategy implements IDragStrategy { private startLoc: Coordinate | null = null; diff --git a/core/dragging/dragger.ts b/core/dragging/dragger.ts index 66d447a6f..8a9ac87c6 100644 --- a/core/dragging/dragger.ts +++ b/core/dragging/dragger.ts @@ -4,18 +4,18 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {IDragTarget} from '../interfaces/i_drag_target.js'; -import {IDeletable, isDeletable} from '../interfaces/i_deletable.js'; -import {IDragger} from '../interfaces/i_dragger.js'; -import {IDraggable} from '../interfaces/i_draggable.js'; -import {Coordinate} from '../utils/coordinate.js'; -import {WorkspaceSvg} from '../workspace_svg.js'; -import {ComponentManager} from '../component_manager.js'; -import {IDeleteArea} from '../interfaces/i_delete_area.js'; -import * as registry from '../registry.js'; -import * as eventUtils from '../events/utils.js'; import * as blockAnimations from '../block_animations.js'; import {BlockSvg} from '../block_svg.js'; +import {ComponentManager} from '../component_manager.js'; +import * as eventUtils from '../events/utils.js'; +import {IDeletable, isDeletable} from '../interfaces/i_deletable.js'; +import {IDeleteArea} from '../interfaces/i_delete_area.js'; +import {IDragTarget} from '../interfaces/i_drag_target.js'; +import {IDraggable} from '../interfaces/i_draggable.js'; +import {IDragger} from '../interfaces/i_dragger.js'; +import * as registry from '../registry.js'; +import {Coordinate} from '../utils/coordinate.js'; +import {WorkspaceSvg} from '../workspace_svg.js'; export class Dragger implements IDragger { protected startLoc: Coordinate; diff --git a/core/dropdowndiv.ts b/core/dropdowndiv.ts index 5b531912a..f9af02ac9 100644 --- a/core/dropdowndiv.ts +++ b/core/dropdowndiv.ts @@ -14,8 +14,8 @@ import type {BlockSvg} from './block_svg.js'; import * as common from './common.js'; -import * as dom from './utils/dom.js'; import type {Field} from './field.js'; +import * as dom from './utils/dom.js'; import * as math from './utils/math.js'; import {Rect} from './utils/rect.js'; import type {Size} from './utils/size.js'; diff --git a/core/events/events.ts b/core/events/events.ts index b31cf7dc7..97dc8cba4 100644 --- a/core/events/events.ts +++ b/core/events/events.ts @@ -21,15 +21,15 @@ import {BubbleOpen, BubbleOpenJson, BubbleType} from './events_bubble_open.js'; import {Click, ClickJson, ClickTarget} from './events_click.js'; import {CommentBase, CommentBaseJson} from './events_comment_base.js'; import {CommentChange, CommentChangeJson} from './events_comment_change.js'; -import {CommentCreate, CommentCreateJson} from './events_comment_create.js'; -import {CommentDelete} from './events_comment_delete.js'; -import {CommentMove, CommentMoveJson} from './events_comment_move.js'; -import {CommentResize, CommentResizeJson} from './events_comment_resize.js'; -import {CommentDrag, CommentDragJson} from './events_comment_drag.js'; import { CommentCollapse, CommentCollapseJson, } from './events_comment_collapse.js'; +import {CommentCreate, CommentCreateJson} from './events_comment_create.js'; +import {CommentDelete} from './events_comment_delete.js'; +import {CommentDrag, CommentDragJson} from './events_comment_drag.js'; +import {CommentMove, CommentMoveJson} from './events_comment_move.js'; +import {CommentResize, CommentResizeJson} from './events_comment_resize.js'; import {MarkerMove, MarkerMoveJson} from './events_marker_move.js'; import {Selected, SelectedJson} from './events_selected.js'; import {ThemeChange, ThemeChangeJson} from './events_theme_change.js'; @@ -48,65 +48,67 @@ import * as eventUtils from './utils.js'; import {FinishedLoading} from './workspace_events.js'; // Events. -export {Abstract}; -export {AbstractEventJson}; -export {BubbleOpen}; -export {BubbleOpenJson}; -export {BubbleType}; -export {BlockBase}; -export {BlockBaseJson}; -export {BlockChange}; -export {BlockChangeJson}; -export {BlockCreate}; -export {BlockCreateJson}; -export {BlockDelete}; -export {BlockDeleteJson}; -export {BlockDrag}; -export {BlockDragJson}; -export {BlockFieldIntermediateChange}; -export {BlockFieldIntermediateChangeJson}; -export {BlockMove}; -export {BlockMoveJson}; -export {Click}; -export {ClickJson}; -export {ClickTarget}; -export {CommentBase}; -export {CommentBaseJson}; -export {CommentChange}; -export {CommentChangeJson}; -export {CommentCreate}; -export {CommentCreateJson}; -export {CommentDelete}; -export {CommentMove}; -export {CommentMoveJson}; -export {CommentResize}; -export {CommentResizeJson}; -export {CommentDrag}; -export {CommentDragJson}; -export {CommentCollapse}; -export {CommentCollapseJson}; -export {FinishedLoading}; -export {MarkerMove}; -export {MarkerMoveJson}; -export {Selected}; -export {SelectedJson}; -export {ThemeChange}; -export {ThemeChangeJson}; -export {ToolboxItemSelect}; -export {ToolboxItemSelectJson}; -export {TrashcanOpen}; -export {TrashcanOpenJson}; -export {UiBase}; -export {VarBase}; -export {VarBaseJson}; -export {VarCreate}; -export {VarCreateJson}; -export {VarDelete}; -export {VarDeleteJson}; -export {VarRename}; -export {VarRenameJson}; -export {ViewportChange}; -export {ViewportChangeJson}; +export { + Abstract, + AbstractEventJson, + BlockBase, + BlockBaseJson, + BlockChange, + BlockChangeJson, + BlockCreate, + BlockCreateJson, + BlockDelete, + BlockDeleteJson, + BlockDrag, + BlockDragJson, + BlockFieldIntermediateChange, + BlockFieldIntermediateChangeJson, + BlockMove, + BlockMoveJson, + BubbleOpen, + BubbleOpenJson, + BubbleType, + Click, + ClickJson, + ClickTarget, + CommentBase, + CommentBaseJson, + CommentChange, + CommentChangeJson, + CommentCollapse, + CommentCollapseJson, + CommentCreate, + CommentCreateJson, + CommentDelete, + CommentDrag, + CommentDragJson, + CommentMove, + CommentMoveJson, + CommentResize, + CommentResizeJson, + FinishedLoading, + MarkerMove, + MarkerMoveJson, + Selected, + SelectedJson, + ThemeChange, + ThemeChangeJson, + ToolboxItemSelect, + ToolboxItemSelectJson, + TrashcanOpen, + TrashcanOpenJson, + UiBase, + VarBase, + VarBaseJson, + VarCreate, + VarCreateJson, + VarDelete, + VarDeleteJson, + VarRename, + VarRenameJson, + ViewportChange, + ViewportChangeJson, +}; // Event types. export const BLOCK_CHANGE = eventUtils.BLOCK_CHANGE; diff --git a/core/events/events_abstract.ts b/core/events/events_abstract.ts index 7f06d48e9..b63c742b5 100644 --- a/core/events/events_abstract.ts +++ b/core/events/events_abstract.ts @@ -14,7 +14,6 @@ import * as common from '../common.js'; import type {Workspace} from '../workspace.js'; - import * as eventUtils from './utils.js'; /** diff --git a/core/events/events_block_base.ts b/core/events/events_block_base.ts index 350985428..d15b8e439 100644 --- a/core/events/events_block_base.ts +++ b/core/events/events_block_base.ts @@ -13,7 +13,6 @@ import type {Block} from '../block.js'; import type {Workspace} from '../workspace.js'; - import { Abstract as AbstractEvent, AbstractEventJson, diff --git a/core/events/events_block_change.ts b/core/events/events_block_change.ts index 570b7f58e..103dc3427 100644 --- a/core/events/events_block_change.ts +++ b/core/events/events_block_change.ts @@ -13,14 +13,13 @@ import type {Block} from '../block.js'; import type {BlockSvg} from '../block_svg.js'; +import {MANUALLY_DISABLED} from '../constants.js'; import {IconType} from '../icons/icon_types.js'; import {hasBubble} from '../interfaces/i_has_bubble.js'; -import {MANUALLY_DISABLED} from '../constants.js'; import * as registry from '../registry.js'; import * as utilsXml from '../utils/xml.js'; import {Workspace} from '../workspace.js'; import * as Xml from '../xml.js'; - import {BlockBase, BlockBaseJson} from './events_block_base.js'; import * as eventUtils from './utils.js'; diff --git a/core/events/events_block_create.ts b/core/events/events_block_create.ts index cbabc9332..6f14a8117 100644 --- a/core/events/events_block_create.ts +++ b/core/events/events_block_create.ts @@ -15,11 +15,10 @@ import type {Block} from '../block.js'; import * as registry from '../registry.js'; import * as blocks from '../serialization/blocks.js'; import * as utilsXml from '../utils/xml.js'; +import {Workspace} from '../workspace.js'; import * as Xml from '../xml.js'; - import {BlockBase, BlockBaseJson} from './events_block_base.js'; import * as eventUtils from './utils.js'; -import {Workspace} from '../workspace.js'; /** * Notifies listeners when a block (or connected stack of blocks) is diff --git a/core/events/events_block_delete.ts b/core/events/events_block_delete.ts index 3375a78dd..e1c04f365 100644 --- a/core/events/events_block_delete.ts +++ b/core/events/events_block_delete.ts @@ -15,11 +15,10 @@ import type {Block} from '../block.js'; import * as registry from '../registry.js'; import * as blocks from '../serialization/blocks.js'; import * as utilsXml from '../utils/xml.js'; +import {Workspace} from '../workspace.js'; import * as Xml from '../xml.js'; - import {BlockBase, BlockBaseJson} from './events_block_base.js'; import * as eventUtils from './utils.js'; -import {Workspace} from '../workspace.js'; /** * Notifies listeners when a block (or connected stack of blocks) is diff --git a/core/events/events_block_drag.ts b/core/events/events_block_drag.ts index 3729ab777..0045d2bec 100644 --- a/core/events/events_block_drag.ts +++ b/core/events/events_block_drag.ts @@ -13,10 +13,10 @@ import type {Block} from '../block.js'; import * as registry from '../registry.js'; +import {Workspace} from '../workspace.js'; import {AbstractEventJson} from './events_abstract.js'; import {UiBase} from './events_ui_base.js'; import * as eventUtils from './utils.js'; -import {Workspace} from '../workspace.js'; /** * Notifies listeners when a block is being manually dragged/dropped. diff --git a/core/events/events_block_field_intermediate_change.ts b/core/events/events_block_field_intermediate_change.ts index 264f910a8..ef077a97a 100644 --- a/core/events/events_block_field_intermediate_change.ts +++ b/core/events/events_block_field_intermediate_change.ts @@ -15,7 +15,6 @@ import type {Block} from '../block.js'; import * as registry from '../registry.js'; import {Workspace} from '../workspace.js'; - import {BlockBase, BlockBaseJson} from './events_block_base.js'; import * as eventUtils from './utils.js'; diff --git a/core/events/events_block_move.ts b/core/events/events_block_move.ts index 6c05ab2af..233880eef 100644 --- a/core/events/events_block_move.ts +++ b/core/events/events_block_move.ts @@ -15,10 +15,9 @@ import type {Block} from '../block.js'; import {ConnectionType} from '../connection_type.js'; import * as registry from '../registry.js'; import {Coordinate} from '../utils/coordinate.js'; - +import type {Workspace} from '../workspace.js'; import {BlockBase, BlockBaseJson} from './events_block_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; interface BlockLocation { parentId?: string; diff --git a/core/events/events_bubble_open.ts b/core/events/events_bubble_open.ts index 023e16a17..fa9b43d25 100644 --- a/core/events/events_bubble_open.ts +++ b/core/events/events_bubble_open.ts @@ -11,12 +11,12 @@ */ // Former goog.module ID: Blockly.Events.BubbleOpen -import type {AbstractEventJson} from './events_abstract.js'; import type {BlockSvg} from '../block_svg.js'; import * as registry from '../registry.js'; +import type {Workspace} from '../workspace.js'; +import type {AbstractEventJson} from './events_abstract.js'; import {UiBase} from './events_ui_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; /** * Class for a bubble open event. diff --git a/core/events/events_click.ts b/core/events/events_click.ts index 1b1556069..ada1ebc3e 100644 --- a/core/events/events_click.ts +++ b/core/events/events_click.ts @@ -13,11 +13,10 @@ import type {Block} from '../block.js'; import * as registry from '../registry.js'; +import {Workspace} from '../workspace.js'; import {AbstractEventJson} from './events_abstract.js'; - import {UiBase} from './events_ui_base.js'; import * as eventUtils from './utils.js'; -import {Workspace} from '../workspace.js'; /** * Notifies listeners that some blockly element was clicked. diff --git a/core/events/events_comment_base.ts b/core/events/events_comment_base.ts index 6fbc95c4d..afda026f2 100644 --- a/core/events/events_comment_base.ts +++ b/core/events/events_comment_base.ts @@ -13,6 +13,7 @@ import type {WorkspaceComment} from '../comments/workspace_comment.js'; import * as comments from '../serialization/workspace_comments.js'; +import type {Workspace} from '../workspace.js'; import { Abstract as AbstractEvent, AbstractEventJson, @@ -20,7 +21,6 @@ import { import type {CommentCreate} from './events_comment_create.js'; import type {CommentDelete} from './events_comment_delete.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; /** * Abstract class for a comment event. diff --git a/core/events/events_comment_change.ts b/core/events/events_comment_change.ts index eb39d929d..ca807a6d2 100644 --- a/core/events/events_comment_change.ts +++ b/core/events/events_comment_change.ts @@ -11,12 +11,11 @@ */ // Former goog.module ID: Blockly.Events.CommentChange -import * as registry from '../registry.js'; import type {WorkspaceComment} from '../comments/workspace_comment.js'; - +import * as registry from '../registry.js'; +import type {Workspace} from '../workspace.js'; import {CommentBase, CommentBaseJson} from './events_comment_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; /** * Notifies listeners that the contents of a workspace comment has changed. diff --git a/core/events/events_comment_collapse.ts b/core/events/events_comment_collapse.ts index 6646b1df2..30147f3d8 100644 --- a/core/events/events_comment_collapse.ts +++ b/core/events/events_comment_collapse.ts @@ -4,11 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -import * as registry from '../registry.js'; import {WorkspaceComment} from '../comments/workspace_comment.js'; +import * as registry from '../registry.js'; +import type {Workspace} from '../workspace.js'; import {CommentBase, CommentBaseJson} from './events_comment_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; export class CommentCollapse extends CommentBase { override type = eventUtils.COMMENT_COLLAPSE; diff --git a/core/events/events_comment_create.ts b/core/events/events_comment_create.ts index 692397df6..b4ee7ad71 100644 --- a/core/events/events_comment_create.ts +++ b/core/events/events_comment_create.ts @@ -11,14 +11,14 @@ */ // Former goog.module ID: Blockly.Events.CommentCreate -import * as registry from '../registry.js'; import type {WorkspaceComment} from '../comments/workspace_comment.js'; +import * as registry from '../registry.js'; import * as comments from '../serialization/workspace_comments.js'; import * as utilsXml from '../utils/xml.js'; +import type {Workspace} from '../workspace.js'; import * as Xml from '../xml.js'; import {CommentBase, CommentBaseJson} from './events_comment_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; /** * Notifies listeners that a workspace comment was created. diff --git a/core/events/events_comment_delete.ts b/core/events/events_comment_delete.ts index 62f8916fb..a429ab824 100644 --- a/core/events/events_comment_delete.ts +++ b/core/events/events_comment_delete.ts @@ -11,14 +11,14 @@ */ // Former goog.module ID: Blockly.Events.CommentDelete -import * as registry from '../registry.js'; import type {WorkspaceComment} from '../comments/workspace_comment.js'; +import * as registry from '../registry.js'; import * as comments from '../serialization/workspace_comments.js'; +import * as utilsXml from '../utils/xml.js'; +import type {Workspace} from '../workspace.js'; +import * as Xml from '../xml.js'; import {CommentBase, CommentBaseJson} from './events_comment_base.js'; import * as eventUtils from './utils.js'; -import * as utilsXml from '../utils/xml.js'; -import * as Xml from '../xml.js'; -import type {Workspace} from '../workspace.js'; /** * Notifies listeners that a workspace comment has been deleted. diff --git a/core/events/events_comment_drag.ts b/core/events/events_comment_drag.ts index 80caeea52..7ca21d4dc 100644 --- a/core/events/events_comment_drag.ts +++ b/core/events/events_comment_drag.ts @@ -10,10 +10,10 @@ import type {WorkspaceComment} from '../comments/workspace_comment.js'; import * as registry from '../registry.js'; +import {Workspace} from '../workspace.js'; import {AbstractEventJson} from './events_abstract.js'; import {UiBase} from './events_ui_base.js'; import * as eventUtils from './utils.js'; -import {Workspace} from '../workspace.js'; /** * Notifies listeners when a comment is being manually dragged/dropped. diff --git a/core/events/events_comment_move.ts b/core/events/events_comment_move.ts index 502ca032f..d50efec5a 100644 --- a/core/events/events_comment_move.ts +++ b/core/events/events_comment_move.ts @@ -11,13 +11,12 @@ */ // Former goog.module ID: Blockly.Events.CommentMove +import type {WorkspaceComment} from '../comments/workspace_comment.js'; import * as registry from '../registry.js'; import {Coordinate} from '../utils/coordinate.js'; -import type {WorkspaceComment} from '../comments/workspace_comment.js'; - +import type {Workspace} from '../workspace.js'; import {CommentBase, CommentBaseJson} from './events_comment_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; /** * Notifies listeners that a workspace comment has moved. diff --git a/core/events/events_comment_resize.ts b/core/events/events_comment_resize.ts index dfc785832..623e0c415 100644 --- a/core/events/events_comment_resize.ts +++ b/core/events/events_comment_resize.ts @@ -8,13 +8,12 @@ * Class for comment resize event. */ +import type {WorkspaceComment} from '../comments/workspace_comment.js'; import * as registry from '../registry.js'; import {Size} from '../utils/size.js'; -import type {WorkspaceComment} from '../comments/workspace_comment.js'; - +import type {Workspace} from '../workspace.js'; import {CommentBase, CommentBaseJson} from './events_comment_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; /** * Notifies listeners that a workspace comment has resized. diff --git a/core/events/events_marker_move.ts b/core/events/events_marker_move.ts index f162eeca9..e5c7dc47d 100644 --- a/core/events/events_marker_move.ts +++ b/core/events/events_marker_move.ts @@ -16,7 +16,6 @@ import {ASTNode} from '../keyboard_nav/ast_node.js'; import * as registry from '../registry.js'; import type {Workspace} from '../workspace.js'; import {AbstractEventJson} from './events_abstract.js'; - import {UiBase} from './events_ui_base.js'; import * as eventUtils from './utils.js'; diff --git a/core/events/events_selected.ts b/core/events/events_selected.ts index c320c6746..1892dcb18 100644 --- a/core/events/events_selected.ts +++ b/core/events/events_selected.ts @@ -12,11 +12,10 @@ // Former goog.module ID: Blockly.Events.Selected import * as registry from '../registry.js'; +import type {Workspace} from '../workspace.js'; import {AbstractEventJson} from './events_abstract.js'; - import {UiBase} from './events_ui_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; /** * Class for a selected event. diff --git a/core/events/events_theme_change.ts b/core/events/events_theme_change.ts index c0267ac6c..c92aa0b7e 100644 --- a/core/events/events_theme_change.ts +++ b/core/events/events_theme_change.ts @@ -12,10 +12,10 @@ // Former goog.module ID: Blockly.Events.ThemeChange import * as registry from '../registry.js'; +import type {Workspace} from '../workspace.js'; import {AbstractEventJson} from './events_abstract.js'; import {UiBase} from './events_ui_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; /** * Notifies listeners that the workspace theme has changed. diff --git a/core/events/events_toolbox_item_select.ts b/core/events/events_toolbox_item_select.ts index f1810dead..f462addf3 100644 --- a/core/events/events_toolbox_item_select.ts +++ b/core/events/events_toolbox_item_select.ts @@ -12,10 +12,10 @@ // Former goog.module ID: Blockly.Events.ToolboxItemSelect import * as registry from '../registry.js'; +import type {Workspace} from '../workspace.js'; import {AbstractEventJson} from './events_abstract.js'; import {UiBase} from './events_ui_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; /** * Notifies listeners that a toolbox item has been selected. diff --git a/core/events/events_trashcan_open.ts b/core/events/events_trashcan_open.ts index 745e7459c..bbd5d2dd9 100644 --- a/core/events/events_trashcan_open.ts +++ b/core/events/events_trashcan_open.ts @@ -12,11 +12,10 @@ // Former goog.module ID: Blockly.Events.TrashcanOpen import * as registry from '../registry.js'; +import type {Workspace} from '../workspace.js'; import {AbstractEventJson} from './events_abstract.js'; - import {UiBase} from './events_ui_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; /** * Notifies listeners when the trashcan is opening or closing. diff --git a/core/events/events_var_base.ts b/core/events/events_var_base.ts index 74537f144..8e359de51 100644 --- a/core/events/events_var_base.ts +++ b/core/events/events_var_base.ts @@ -12,12 +12,11 @@ // Former goog.module ID: Blockly.Events.VarBase import type {VariableModel} from '../variable_model.js'; - +import type {Workspace} from '../workspace.js'; import { Abstract as AbstractEvent, AbstractEventJson, } from './events_abstract.js'; -import type {Workspace} from '../workspace.js'; /** * Abstract class for a variable event. diff --git a/core/events/events_var_create.ts b/core/events/events_var_create.ts index a719cad98..6376e1a61 100644 --- a/core/events/events_var_create.ts +++ b/core/events/events_var_create.ts @@ -13,10 +13,9 @@ import * as registry from '../registry.js'; import type {VariableModel} from '../variable_model.js'; - +import type {Workspace} from '../workspace.js'; import {VarBase, VarBaseJson} from './events_var_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; /** * Notifies listeners that a variable model has been created. diff --git a/core/events/events_var_delete.ts b/core/events/events_var_delete.ts index fc19461d4..125269791 100644 --- a/core/events/events_var_delete.ts +++ b/core/events/events_var_delete.ts @@ -8,10 +8,9 @@ import * as registry from '../registry.js'; import type {VariableModel} from '../variable_model.js'; - +import type {Workspace} from '../workspace.js'; import {VarBase, VarBaseJson} from './events_var_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; /** * Notifies listeners that a variable model has been deleted. diff --git a/core/events/events_var_rename.ts b/core/events/events_var_rename.ts index 3bb1e90eb..268d6abc9 100644 --- a/core/events/events_var_rename.ts +++ b/core/events/events_var_rename.ts @@ -8,10 +8,9 @@ import * as registry from '../registry.js'; import type {VariableModel} from '../variable_model.js'; - +import type {Workspace} from '../workspace.js'; import {VarBase, VarBaseJson} from './events_var_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; /** * Notifies listeners that a variable model was renamed. diff --git a/core/events/events_viewport.ts b/core/events/events_viewport.ts index aff236e48..243477099 100644 --- a/core/events/events_viewport.ts +++ b/core/events/events_viewport.ts @@ -12,10 +12,10 @@ // Former goog.module ID: Blockly.Events.ViewportChange import * as registry from '../registry.js'; +import type {Workspace} from '../workspace.js'; import {AbstractEventJson} from './events_abstract.js'; import {UiBase} from './events_ui_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; /** * Notifies listeners that the workspace surface's position or scale has diff --git a/core/events/utils.ts b/core/events/utils.ts index 0bb69980e..2e2701cf9 100644 --- a/core/events/utils.ts +++ b/core/events/utils.ts @@ -12,7 +12,6 @@ import * as registry from '../registry.js'; import * as idGenerator from '../utils/idgenerator.js'; import type {Workspace} from '../workspace.js'; import type {WorkspaceSvg} from '../workspace_svg.js'; - import type {Abstract} from './events_abstract.js'; import type {BlockChange} from './events_block_change.js'; import type {BlockCreate} from './events_block_create.js'; diff --git a/core/field.ts b/core/field.ts index 777b19f55..87a27f446 100644 --- a/core/field.ts +++ b/core/field.ts @@ -26,6 +26,7 @@ import type {IASTNodeLocationSvg} from './interfaces/i_ast_node_location_svg.js' import type {IASTNodeLocationWithBlock} from './interfaces/i_ast_node_location_with_block.js'; import type {IKeyboardAccessible} from './interfaces/i_keyboard_accessible.js'; import type {IRegistrable} from './interfaces/i_registrable.js'; +import {ISerializable} from './interfaces/i_serializable.js'; import {MarkerManager} from './marker_manager.js'; import type {ConstantProvider} from './renderers/common/constants.js'; import type {KeyboardShortcut} from './shortcut_registry.js'; @@ -41,7 +42,6 @@ import * as userAgent from './utils/useragent.js'; import * as utilsXml from './utils/xml.js'; import * as WidgetDiv from './widgetdiv.js'; import type {WorkspaceSvg} from './workspace_svg.js'; -import {ISerializable} from './interfaces/i_serializable.js'; /** * A function that is called to validate changes to the field's value before diff --git a/core/field_checkbox.ts b/core/field_checkbox.ts index 83f460bb9..01d1851aa 100644 --- a/core/field_checkbox.ts +++ b/core/field_checkbox.ts @@ -14,9 +14,9 @@ // Unused import preserved for side-effects. Remove if unneeded. import './events/events_block_change.js'; -import * as dom from './utils/dom.js'; import {Field, FieldConfig, FieldValidator} from './field.js'; import * as fieldRegistry from './field_registry.js'; +import * as dom from './utils/dom.js'; type BoolString = 'TRUE' | 'FALSE'; type CheckboxBool = BoolString | boolean; diff --git a/core/field_dropdown.ts b/core/field_dropdown.ts index 58a4b0732..71b17326d 100644 --- a/core/field_dropdown.ts +++ b/core/field_dropdown.ts @@ -24,12 +24,12 @@ import { import * as fieldRegistry from './field_registry.js'; import {Menu} from './menu.js'; import {MenuItem} from './menuitem.js'; -import * as style from './utils/style.js'; import * as aria from './utils/aria.js'; import {Coordinate} from './utils/coordinate.js'; import * as dom from './utils/dom.js'; import * as parsing from './utils/parsing.js'; import * as utilsString from './utils/string.js'; +import * as style from './utils/style.js'; import {Svg} from './utils/svg.js'; /** diff --git a/core/field_input.ts b/core/field_input.ts index 85431cc5b..c3641f4f8 100644 --- a/core/field_input.ts +++ b/core/field_input.ts @@ -15,10 +15,9 @@ import './events/events_block_change.js'; import {BlockSvg} from './block_svg.js'; -import * as bumpObjects from './bump_objects.js'; import * as browserEvents from './browser_events.js'; +import * as bumpObjects from './bump_objects.js'; import * as dialog from './dialog.js'; -import * as dom from './utils/dom.js'; import * as dropDownDiv from './dropdowndiv.js'; import * as eventUtils from './events/utils.js'; import { @@ -30,10 +29,11 @@ import { import {Msg} from './msg.js'; import * as aria from './utils/aria.js'; import {Coordinate} from './utils/coordinate.js'; +import * as dom from './utils/dom.js'; +import {Size} from './utils/size.js'; import * as userAgent from './utils/useragent.js'; import * as WidgetDiv from './widgetdiv.js'; import type {WorkspaceSvg} from './workspace_svg.js'; -import {Size} from './utils/size.js'; /** * Supported types for FieldInput subclasses. diff --git a/core/field_label.ts b/core/field_label.ts index 2b77b0d25..2b0ae1eba 100644 --- a/core/field_label.ts +++ b/core/field_label.ts @@ -12,9 +12,9 @@ */ // Former goog.module ID: Blockly.FieldLabel -import * as dom from './utils/dom.js'; import {Field, FieldConfig} from './field.js'; import * as fieldRegistry from './field_registry.js'; +import * as dom from './utils/dom.js'; import * as parsing from './utils/parsing.js'; /** diff --git a/core/field_number.ts b/core/field_number.ts index e8e51d060..0641b9ae3 100644 --- a/core/field_number.ts +++ b/core/field_number.ts @@ -12,12 +12,12 @@ // Former goog.module ID: Blockly.FieldNumber import {Field} from './field.js'; -import * as fieldRegistry from './field_registry.js'; import { FieldInput, FieldInputConfig, FieldInputValidator, } from './field_input.js'; +import * as fieldRegistry from './field_registry.js'; import * as aria from './utils/aria.js'; /** diff --git a/core/flyout_base.ts b/core/flyout_base.ts index e81df4279..2a048a2c9 100644 --- a/core/flyout_base.ts +++ b/core/flyout_base.ts @@ -11,19 +11,21 @@ */ // Former goog.module ID: Blockly.Flyout -import type {Abstract as AbstractEvent} from './events/events_abstract.js'; import type {Block} from './block.js'; import {BlockSvg} from './block_svg.js'; import * as browserEvents from './browser_events.js'; import * as common from './common.js'; import {ComponentManager} from './component_manager.js'; +import {MANUALLY_DISABLED} from './constants.js'; import {DeleteArea} from './delete_area.js'; +import type {Abstract as AbstractEvent} from './events/events_abstract.js'; import * as eventUtils from './events/utils.js'; import {FlyoutButton} from './flyout_button.js'; import {FlyoutMetricsManager} from './flyout_metrics_manager.js'; +import {IAutoHideable} from './interfaces/i_autohideable.js'; import type {IFlyout} from './interfaces/i_flyout.js'; -import {MANUALLY_DISABLED} from './constants.js'; import type {Options} from './options.js'; +import * as renderManagement from './render_management.js'; import {ScrollbarPair} from './scrollbar_pair.js'; import * as blocks from './serialization/blocks.js'; import * as Tooltip from './tooltip.js'; @@ -32,12 +34,10 @@ import * as dom from './utils/dom.js'; import * as idGenerator from './utils/idgenerator.js'; import {Svg} from './utils/svg.js'; import * as toolbox from './utils/toolbox.js'; +import * as utilsXml from './utils/xml.js'; import * as Variables from './variables.js'; import {WorkspaceSvg} from './workspace_svg.js'; -import * as utilsXml from './utils/xml.js'; import * as Xml from './xml.js'; -import * as renderManagement from './render_management.js'; -import {IAutoHideable} from './interfaces/i_autohideable.js'; enum FlyoutItemType { BLOCK = 'block', diff --git a/core/flyout_button.ts b/core/flyout_button.ts index e73403d77..b03a8d961 100644 --- a/core/flyout_button.ts +++ b/core/flyout_button.ts @@ -11,6 +11,7 @@ */ // Former goog.module ID: Blockly.FlyoutButton +import type {IASTNodeLocationSvg} from './blockly.js'; import * as browserEvents from './browser_events.js'; import * as Css from './css.js'; import {Coordinate} from './utils/coordinate.js'; @@ -20,7 +21,6 @@ import * as style from './utils/style.js'; import {Svg} from './utils/svg.js'; import type * as toolbox from './utils/toolbox.js'; import type {WorkspaceSvg} from './workspace_svg.js'; -import type {IASTNodeLocationSvg} from './blockly.js'; /** * Class for a button or label in the flyout. diff --git a/core/gesture.ts b/core/gesture.ts index 0aefba47d..a9a04e046 100644 --- a/core/gesture.ts +++ b/core/gesture.ts @@ -18,23 +18,23 @@ import './events/events_click.js'; import * as blockAnimations from './block_animations.js'; import type {BlockSvg} from './block_svg.js'; import * as browserEvents from './browser_events.js'; +import {RenderedWorkspaceComment} from './comments.js'; import * as common from './common.js'; import {config} from './config.js'; import * as dropDownDiv from './dropdowndiv.js'; import * as eventUtils from './events/utils.js'; import type {Field} from './field.js'; import type {IBubble} from './interfaces/i_bubble.js'; +import {IDraggable, isDraggable} from './interfaces/i_draggable.js'; +import {IDragger} from './interfaces/i_dragger.js'; import type {IFlyout} from './interfaces/i_flyout.js'; +import type {IIcon} from './interfaces/i_icon.js'; +import * as registry from './registry.js'; import * as Tooltip from './tooltip.js'; import * as Touch from './touch.js'; import {Coordinate} from './utils/coordinate.js'; import {WorkspaceDragger} from './workspace_dragger.js'; import type {WorkspaceSvg} from './workspace_svg.js'; -import type {IIcon} from './interfaces/i_icon.js'; -import {IDragger} from './interfaces/i_dragger.js'; -import * as registry from './registry.js'; -import {IDraggable, isDraggable} from './interfaces/i_draggable.js'; -import {RenderedWorkspaceComment} from './comments.js'; /** * Note: In this file "start" refers to pointerdown diff --git a/core/grid.ts b/core/grid.ts index 1a5de250e..e2fc054a2 100644 --- a/core/grid.ts +++ b/core/grid.ts @@ -12,10 +12,10 @@ */ // Former goog.module ID: Blockly.Grid -import * as dom from './utils/dom.js'; -import {Coordinate} from './utils/coordinate.js'; -import {Svg} from './utils/svg.js'; import {GridOptions} from './options.js'; +import {Coordinate} from './utils/coordinate.js'; +import * as dom from './utils/dom.js'; +import {Svg} from './utils/svg.js'; /** * Class for a workspace's grid. diff --git a/core/icons.ts b/core/icons.ts index 61d1594b8..fcc7c98c6 100644 --- a/core/icons.ts +++ b/core/icons.ts @@ -4,21 +4,21 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {Icon} from './icons/icon.js'; import {CommentIcon, CommentState} from './icons/comment_icon.js'; -import {MutatorIcon} from './icons/mutator_icon.js'; -import {WarningIcon} from './icons/warning_icon.js'; -import {IconType} from './icons/icon_types.js'; import * as exceptions from './icons/exceptions.js'; +import {Icon} from './icons/icon.js'; +import {IconType} from './icons/icon_types.js'; +import {MutatorIcon} from './icons/mutator_icon.js'; import * as registry from './icons/registry.js'; +import {WarningIcon} from './icons/warning_icon.js'; export { - Icon, CommentIcon, CommentState, - MutatorIcon, - WarningIcon, - IconType, exceptions, + Icon, + IconType, + MutatorIcon, registry, + WarningIcon, }; diff --git a/core/icons/comment_icon.ts b/core/icons/comment_icon.ts index df54560c5..d06952b7a 100644 --- a/core/icons/comment_icon.ts +++ b/core/icons/comment_icon.ts @@ -8,21 +8,21 @@ import type {Block} from '../block.js'; import type {BlockSvg} from '../block_svg.js'; -import {IconType} from './icon_types.js'; -import {Coordinate} from '../utils.js'; -import * as dom from '../utils/dom.js'; -import * as eventUtils from '../events/utils.js'; -import {Icon} from './icon.js'; -import type {IHasBubble} from '../interfaces/i_has_bubble.js'; -import type {ISerializable} from '../interfaces/i_serializable.js'; -import {Rect} from '../utils/rect.js'; -import * as registry from './registry.js'; -import {Size} from '../utils/size.js'; -import {Svg} from '../utils/svg.js'; import {TextBubble} from '../bubbles/text_bubble.js'; import {TextInputBubble} from '../bubbles/textinput_bubble.js'; -import type {WorkspaceSvg} from '../workspace_svg.js'; +import * as eventUtils from '../events/utils.js'; +import type {IHasBubble} from '../interfaces/i_has_bubble.js'; +import type {ISerializable} from '../interfaces/i_serializable.js'; import * as renderManagement from '../render_management.js'; +import {Coordinate} from '../utils.js'; +import * as dom from '../utils/dom.js'; +import {Rect} from '../utils/rect.js'; +import {Size} from '../utils/size.js'; +import {Svg} from '../utils/svg.js'; +import type {WorkspaceSvg} from '../workspace_svg.js'; +import {Icon} from './icon.js'; +import {IconType} from './icon_types.js'; +import * as registry from './registry.js'; /** The size of the comment icon in workspace-scale units. */ const SIZE = 17; diff --git a/core/icons/icon.ts b/core/icons/icon.ts index 6ad953236..30a6b538f 100644 --- a/core/icons/icon.ts +++ b/core/icons/icon.ts @@ -9,12 +9,12 @@ import type {BlockSvg} from '../block_svg.js'; import * as browserEvents from '../browser_events.js'; import {hasBubble} from '../interfaces/i_has_bubble.js'; import type {IIcon} from '../interfaces/i_icon.js'; +import * as tooltip from '../tooltip.js'; import {Coordinate} from '../utils/coordinate.js'; import * as dom from '../utils/dom.js'; import {Size} from '../utils/size.js'; import {Svg} from '../utils/svg.js'; import type {IconType} from './icon_types.js'; -import * as tooltip from '../tooltip.js'; /** * The abstract icon class. Icons are visual elements that live in the top-start diff --git a/core/icons/mutator_icon.ts b/core/icons/mutator_icon.ts index 7fb3fcf3b..1aac847ca 100644 --- a/core/icons/mutator_icon.ts +++ b/core/icons/mutator_icon.ts @@ -6,22 +6,22 @@ // Former goog.module ID: Blockly.Mutator +import type {BlockSvg} from '../block_svg.js'; +import type {BlocklyOptions} from '../blockly_options.js'; +import {MiniWorkspaceBubble} from '../bubbles/mini_workspace_bubble.js'; import type {Abstract} from '../events/events_abstract.js'; import {BlockChange} from '../events/events_block_change.js'; -import type {BlocklyOptions} from '../blockly_options.js'; -import type {BlockSvg} from '../block_svg.js'; -import {Coordinate} from '../utils/coordinate.js'; -import * as dom from '../utils/dom.js'; import * as eventUtils from '../events/utils.js'; import type {IHasBubble} from '../interfaces/i_has_bubble.js'; -import {Icon} from './icon.js'; -import {MiniWorkspaceBubble} from '../bubbles/mini_workspace_bubble.js'; +import * as renderManagement from '../render_management.js'; +import {Coordinate} from '../utils/coordinate.js'; +import * as dom from '../utils/dom.js'; import {Rect} from '../utils/rect.js'; import {Size} from '../utils/size.js'; import {Svg} from '../utils/svg.js'; import type {WorkspaceSvg} from '../workspace_svg.js'; +import {Icon} from './icon.js'; import {IconType} from './icon_types.js'; -import * as renderManagement from '../render_management.js'; /** The size of the mutator icon in workspace-scale units. */ const SIZE = 17; diff --git a/core/icons/warning_icon.ts b/core/icons/warning_icon.ts index 08f511a60..845094876 100644 --- a/core/icons/warning_icon.ts +++ b/core/icons/warning_icon.ts @@ -7,17 +7,17 @@ // Former goog.module ID: Blockly.Warning import type {BlockSvg} from '../block_svg.js'; +import {TextBubble} from '../bubbles/text_bubble.js'; +import * as eventUtils from '../events/utils.js'; +import type {IHasBubble} from '../interfaces/i_has_bubble.js'; +import * as renderManagement from '../render_management.js'; +import {Size} from '../utils.js'; import {Coordinate} from '../utils/coordinate.js'; import * as dom from '../utils/dom.js'; -import * as eventUtils from '../events/utils.js'; -import {Icon} from './icon.js'; -import type {IHasBubble} from '../interfaces/i_has_bubble.js'; import {Rect} from '../utils/rect.js'; -import {Size} from '../utils.js'; import {Svg} from '../utils/svg.js'; -import {TextBubble} from '../bubbles/text_bubble.js'; +import {Icon} from './icon.js'; import {IconType} from './icon_types.js'; -import * as renderManagement from '../render_management.js'; /** The size of the warning icon in workspace-scale units. */ const SIZE = 17; diff --git a/core/inputs.ts b/core/inputs.ts index 4b7bfa897..064d37530 100644 --- a/core/inputs.ts +++ b/core/inputs.ts @@ -5,19 +5,19 @@ */ import {Align} from './inputs/align.js'; -import {Input} from './inputs/input.js'; import {DummyInput} from './inputs/dummy_input.js'; import {EndRowInput} from './inputs/end_row_input.js'; +import {Input} from './inputs/input.js'; +import {inputTypes} from './inputs/input_types.js'; import {StatementInput} from './inputs/statement_input.js'; import {ValueInput} from './inputs/value_input.js'; -import {inputTypes} from './inputs/input_types.js'; export { Align, - Input, DummyInput, EndRowInput, + Input, + inputTypes, StatementInput, ValueInput, - inputTypes, }; diff --git a/core/inputs/input.ts b/core/inputs/input.ts index da7cccad5..0907bf449 100644 --- a/core/inputs/input.ts +++ b/core/inputs/input.ts @@ -21,8 +21,8 @@ import type {ConnectionType} from '../connection_type.js'; import type {Field} from '../field.js'; import * as fieldRegistry from '../field_registry.js'; import type {RenderedConnection} from '../rendered_connection.js'; -import {inputTypes} from './input_types.js'; import {Align} from './align.js'; +import {inputTypes} from './input_types.js'; /** Class for an input with optional fields. */ export class Input { diff --git a/core/insertion_marker_manager.ts b/core/insertion_marker_manager.ts index 6f27eada7..13d630420 100644 --- a/core/insertion_marker_manager.ts +++ b/core/insertion_marker_manager.ts @@ -11,20 +11,20 @@ */ // Former goog.module ID: Blockly.InsertionMarkerManager -import {finishQueuedRenders} from './render_management.js'; import * as blockAnimations from './block_animations.js'; import type {BlockSvg} from './block_svg.js'; import * as common from './common.js'; import {ComponentManager} from './component_manager.js'; import {config} from './config.js'; -import * as blocks from './serialization/blocks.js'; import * as eventUtils from './events/utils.js'; import type {IDeleteArea} from './interfaces/i_delete_area.js'; import type {IDragTarget} from './interfaces/i_drag_target.js'; +import * as renderManagement from './render_management.js'; +import {finishQueuedRenders} from './render_management.js'; import type {RenderedConnection} from './rendered_connection.js'; +import * as blocks from './serialization/blocks.js'; import type {Coordinate} from './utils/coordinate.js'; import type {WorkspaceSvg} from './workspace_svg.js'; -import * as renderManagement from './render_management.js'; /** Represents a nearby valid connection. */ interface CandidateConnection { diff --git a/core/insertion_marker_previewer.ts b/core/insertion_marker_previewer.ts index 3cc9f1a04..2343b9adc 100644 --- a/core/insertion_marker_previewer.ts +++ b/core/insertion_marker_previewer.ts @@ -5,15 +5,15 @@ */ import {BlockSvg} from './block_svg.js'; -import {IConnectionPreviewer} from './interfaces/i_connection_previewer.js'; -import {RenderedConnection} from './rendered_connection.js'; -import {WorkspaceSvg} from './workspace_svg.js'; -import * as blocks from './serialization/blocks.js'; -import * as eventUtils from './events/utils.js'; -import * as renderManagement from './render_management.js'; -import * as registry from './registry.js'; -import {Renderer as ZelosRenderer} from './renderers/zelos/renderer.js'; import {ConnectionType} from './connection_type.js'; +import * as eventUtils from './events/utils.js'; +import {IConnectionPreviewer} from './interfaces/i_connection_previewer.js'; +import * as registry from './registry.js'; +import * as renderManagement from './render_management.js'; +import {RenderedConnection} from './rendered_connection.js'; +import {Renderer as ZelosRenderer} from './renderers/zelos/renderer.js'; +import * as blocks from './serialization/blocks.js'; +import {WorkspaceSvg} from './workspace_svg.js'; export class InsertionMarkerPreviewer implements IConnectionPreviewer { private readonly workspace: WorkspaceSvg; diff --git a/core/interfaces/i_ast_node_location_with_block.ts b/core/interfaces/i_ast_node_location_with_block.ts index a00603864..b04234fd4 100644 --- a/core/interfaces/i_ast_node_location_with_block.ts +++ b/core/interfaces/i_ast_node_location_with_block.ts @@ -6,8 +6,8 @@ // Former goog.module ID: Blockly.IASTNodeLocationWithBlock -import type {IASTNodeLocation} from './i_ast_node_location.js'; import type {Block} from '../block.js'; +import type {IASTNodeLocation} from './i_ast_node_location.js'; /** * An AST node location that has an associated block. diff --git a/core/interfaces/i_bounded_element.ts b/core/interfaces/i_bounded_element.ts index a32df5985..aac26855b 100644 --- a/core/interfaces/i_bounded_element.ts +++ b/core/interfaces/i_bounded_element.ts @@ -4,9 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type {Rect} from '../utils/rect.js'; // Former goog.module ID: Blockly.IBoundedElement +import type {Rect} from '../utils/rect.js'; + /** * A bounded element interface. */ diff --git a/core/interfaces/i_bubble.ts b/core/interfaces/i_bubble.ts index e27fccafd..d31ce9c9d 100644 --- a/core/interfaces/i_bubble.ts +++ b/core/interfaces/i_bubble.ts @@ -4,9 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type {Coordinate} from '../utils/coordinate.js'; // Former goog.module ID: Blockly.IBubble +import type {Coordinate} from '../utils/coordinate.js'; import type {IContextMenu} from './i_contextmenu.js'; import type {IDraggable} from './i_draggable.js'; diff --git a/core/interfaces/i_comment_icon.ts b/core/interfaces/i_comment_icon.ts index 47c46daaf..9801a8d6e 100644 --- a/core/interfaces/i_comment_icon.ts +++ b/core/interfaces/i_comment_icon.ts @@ -4,11 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {IconType} from '../icons/icon_types.js'; import {CommentState} from '../icons/comment_icon.js'; -import {IIcon, isIcon} from './i_icon.js'; +import {IconType} from '../icons/icon_types.js'; import {Size} from '../utils/size.js'; import {IHasBubble, hasBubble} from './i_has_bubble.js'; +import {IIcon, isIcon} from './i_icon.js'; import {ISerializable, isSerializable} from './i_serializable.js'; export interface ICommentIcon extends IIcon, IHasBubble, ISerializable { diff --git a/core/interfaces/i_connection_checker.ts b/core/interfaces/i_connection_checker.ts index 8bb0fcc73..352b719d6 100644 --- a/core/interfaces/i_connection_checker.ts +++ b/core/interfaces/i_connection_checker.ts @@ -4,9 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ +// Former goog.module ID: Blockly.IConnectionChecker + import type {Connection} from '../connection.js'; import type {RenderedConnection} from '../rendered_connection.js'; -// Former goog.module ID: Blockly.IConnectionChecker /** * Class for connection type checking logic. diff --git a/core/interfaces/i_drag_target.ts b/core/interfaces/i_drag_target.ts index 3fa060232..395b23451 100644 --- a/core/interfaces/i_drag_target.ts +++ b/core/interfaces/i_drag_target.ts @@ -4,13 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {Rect} from '../utils/rect.js'; - -import {IDraggable} from './i_draggable.js'; - // Former goog.module ID: Blockly.IDragTarget +import {Rect} from '../utils/rect.js'; import type {IComponent} from './i_component.js'; +import {IDraggable} from './i_draggable.js'; /** * Interface for a component with custom behaviour when a block or bubble is diff --git a/core/interfaces/i_flyout.ts b/core/interfaces/i_flyout.ts index 84067f755..c79be344c 100644 --- a/core/interfaces/i_flyout.ts +++ b/core/interfaces/i_flyout.ts @@ -6,13 +6,13 @@ // Former goog.module ID: Blockly.IFlyout -import type {WorkspaceSvg} from '../workspace_svg.js'; import type {BlockSvg} from '../block_svg.js'; -import type {Coordinate} from '../utils/coordinate.js'; -import type {FlyoutDefinition} from '../utils/toolbox.js'; -import type {Svg} from '../utils/svg.js'; -import type {IRegistrable} from './i_registrable.js'; import {FlyoutItem} from '../flyout_base.js'; +import type {Coordinate} from '../utils/coordinate.js'; +import type {Svg} from '../utils/svg.js'; +import type {FlyoutDefinition} from '../utils/toolbox.js'; +import type {WorkspaceSvg} from '../workspace_svg.js'; +import type {IRegistrable} from './i_registrable.js'; /** * Interface for a flyout. diff --git a/core/interfaces/i_keyboard_accessible.ts b/core/interfaces/i_keyboard_accessible.ts index 50e85b08e..4d04e9d4f 100644 --- a/core/interfaces/i_keyboard_accessible.ts +++ b/core/interfaces/i_keyboard_accessible.ts @@ -4,9 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {KeyboardShortcut} from '../shortcut_registry.js'; // Former goog.module ID: Blockly.IKeyboardAccessible +import {KeyboardShortcut} from '../shortcut_registry.js'; + /** * An interface for an object that handles keyboard shortcuts. */ diff --git a/core/interfaces/i_metrics_manager.ts b/core/interfaces/i_metrics_manager.ts index 52b9644df..bb4d54da4 100644 --- a/core/interfaces/i_metrics_manager.ts +++ b/core/interfaces/i_metrics_manager.ts @@ -4,15 +4,16 @@ * SPDX-License-Identifier: Apache-2.0 */ +// Former goog.module ID: Blockly.IMetricsManager + import type { + AbsoluteMetrics, ContainerRegion, ToolboxMetrics, - AbsoluteMetrics, UiMetrics, } from '../metrics_manager.js'; -import type {Size} from '../utils/size.js'; import type {Metrics} from '../utils/metrics.js'; -// Former goog.module ID: Blockly.IMetricsManager +import type {Size} from '../utils/size.js'; /** * Interface for a metrics manager. diff --git a/core/interfaces/i_positionable.ts b/core/interfaces/i_positionable.ts index 19843d153..4ea7dafa0 100644 --- a/core/interfaces/i_positionable.ts +++ b/core/interfaces/i_positionable.ts @@ -4,10 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type {Rect} from '../utils/rect.js'; -import type {UiMetrics} from '../metrics_manager.js'; // Former goog.module ID: Blockly.IPositionable +import type {UiMetrics} from '../metrics_manager.js'; +import type {Rect} from '../utils/rect.js'; import type {IComponent} from './i_component.js'; /** diff --git a/core/interfaces/i_procedure_block.ts b/core/interfaces/i_procedure_block.ts index 3744eb183..f85380527 100644 --- a/core/interfaces/i_procedure_block.ts +++ b/core/interfaces/i_procedure_block.ts @@ -4,9 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ +// Former goog.module ID: Blockly.procedures.IProcedureBlock + import type {Block} from '../block.js'; import {IProcedureModel} from './i_procedure_model.js'; -// Former goog.module ID: Blockly.procedures.IProcedureBlock /** The interface for a block which models a procedure. */ export interface IProcedureBlock { diff --git a/core/interfaces/i_selectable_toolbox_item.ts b/core/interfaces/i_selectable_toolbox_item.ts index b3267efd0..890d4e370 100644 --- a/core/interfaces/i_selectable_toolbox_item.ts +++ b/core/interfaces/i_selectable_toolbox_item.ts @@ -4,9 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type {FlyoutItemInfoArray} from '../utils/toolbox'; // Former goog.module ID: Blockly.ISelectableToolboxItem +import type {FlyoutItemInfoArray} from '../utils/toolbox'; import type {IToolboxItem} from './i_toolbox_item.js'; /** diff --git a/core/interfaces/i_serializer.ts b/core/interfaces/i_serializer.ts index a33e6b225..0e8302f39 100644 --- a/core/interfaces/i_serializer.ts +++ b/core/interfaces/i_serializer.ts @@ -22,8 +22,6 @@ export interface ISerializer { */ priority: number; - /* eslint-disable no-unused-vars, valid-jsdoc */ - /** * Saves the state of the plugin or system. * @@ -52,4 +50,3 @@ export interface ISerializer { */ clear(workspace: Workspace): void; } -/* eslint-enable no-unused-vars */ diff --git a/core/interfaces/i_toolbox.ts b/core/interfaces/i_toolbox.ts index a236d4442..2756099ec 100644 --- a/core/interfaces/i_toolbox.ts +++ b/core/interfaces/i_toolbox.ts @@ -6,11 +6,11 @@ // Former goog.module ID: Blockly.IToolbox +import type {ToolboxInfo} from '../utils/toolbox.js'; +import type {WorkspaceSvg} from '../workspace_svg.js'; +import type {IFlyout} from './i_flyout.js'; import type {IRegistrable} from './i_registrable.js'; import type {IToolboxItem} from './i_toolbox_item.js'; -import type {ToolboxInfo} from '../utils/toolbox.js'; -import type {IFlyout} from './i_flyout.js'; -import type {WorkspaceSvg} from '../workspace_svg.js'; /** * Interface for a toolbox. diff --git a/core/keyboard_nav/ast_node.ts b/core/keyboard_nav/ast_node.ts index 7985ac6dc..3b0efae3f 100644 --- a/core/keyboard_nav/ast_node.ts +++ b/core/keyboard_nav/ast_node.ts @@ -16,14 +16,14 @@ import {Block} from '../block.js'; import type {Connection} from '../connection.js'; import {ConnectionType} from '../connection_type.js'; import type {Field} from '../field.js'; +import {FlyoutItem} from '../flyout_base.js'; +import {FlyoutButton} from '../flyout_button.js'; import type {Input} from '../inputs/input.js'; import type {IASTNodeLocation} from '../interfaces/i_ast_node_location.js'; import type {IASTNodeLocationWithBlock} from '../interfaces/i_ast_node_location_with_block.js'; import {Coordinate} from '../utils/coordinate.js'; import type {Workspace} from '../workspace.js'; -import {FlyoutButton} from '../flyout_button.js'; import {WorkspaceSvg} from '../workspace_svg.js'; -import {FlyoutItem} from '../flyout_base.js'; /** * Class for an AST node. diff --git a/core/keyboard_nav/basic_cursor.ts b/core/keyboard_nav/basic_cursor.ts index 95b5e2f4d..752614152 100644 --- a/core/keyboard_nav/basic_cursor.ts +++ b/core/keyboard_nav/basic_cursor.ts @@ -13,7 +13,6 @@ // Former goog.module ID: Blockly.BasicCursor import * as registry from '../registry.js'; - import {ASTNode} from './ast_node.js'; import {Cursor} from './cursor.js'; diff --git a/core/keyboard_nav/cursor.ts b/core/keyboard_nav/cursor.ts index da0a50f1c..92279da56 100644 --- a/core/keyboard_nav/cursor.ts +++ b/core/keyboard_nav/cursor.ts @@ -13,7 +13,6 @@ // Former goog.module ID: Blockly.Cursor import * as registry from '../registry.js'; - import {ASTNode} from './ast_node.js'; import {Marker} from './marker.js'; diff --git a/core/keyboard_nav/marker.ts b/core/keyboard_nav/marker.ts index 9653e6b85..e3b438e6e 100644 --- a/core/keyboard_nav/marker.ts +++ b/core/keyboard_nav/marker.ts @@ -12,9 +12,7 @@ */ // Former goog.module ID: Blockly.Marker -/* eslint-disable-next-line no-unused-vars */ import type {MarkerSvg} from '../renderers/common/marker_svg.js'; - import type {ASTNode} from './ast_node.js'; /** diff --git a/core/keyboard_nav/tab_navigate_cursor.ts b/core/keyboard_nav/tab_navigate_cursor.ts index 20fd3dabb..0392887a1 100644 --- a/core/keyboard_nav/tab_navigate_cursor.ts +++ b/core/keyboard_nav/tab_navigate_cursor.ts @@ -13,7 +13,6 @@ // Former goog.module ID: Blockly.TabNavigateCursor import type {Field} from '../field.js'; - import {ASTNode} from './ast_node.js'; import {BasicCursor} from './basic_cursor.js'; diff --git a/core/layer_manager.ts b/core/layer_manager.ts index e181e6801..e7663b1b7 100644 --- a/core/layer_manager.ts +++ b/core/layer_manager.ts @@ -4,12 +4,12 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {WorkspaceSvg} from './workspace_svg.js'; -import * as dom from './utils/dom.js'; -import {Svg} from './utils/svg.js'; import {IRenderedElement} from './interfaces/i_rendered_element.js'; import * as layerNums from './layers.js'; import {Coordinate} from './utils/coordinate.js'; +import * as dom from './utils/dom.js'; +import {Svg} from './utils/svg.js'; +import {WorkspaceSvg} from './workspace_svg.js'; /** @internal */ export class LayerManager { diff --git a/core/observable_procedure_map.ts b/core/observable_procedure_map.ts index e8722bcbf..2f1010755 100644 --- a/core/observable_procedure_map.ts +++ b/core/observable_procedure_map.ts @@ -4,9 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +import {isObservable} from './interfaces/i_observable.js'; import {IProcedureMap} from './interfaces/i_procedure_map.js'; import type {IProcedureModel} from './interfaces/i_procedure_model.js'; -import {isObservable} from './interfaces/i_observable.js'; export class ObservableProcedureMap extends Map diff --git a/core/procedures.ts b/core/procedures.ts index 680abb8af..7ab62a91d 100644 --- a/core/procedures.ts +++ b/core/procedures.ts @@ -17,27 +17,27 @@ import type {Abstract} from './events/events_abstract.js'; import type {BubbleOpen} from './events/events_bubble_open.js'; import * as eventUtils from './events/utils.js'; import {Field, UnattachedFieldError} from './field.js'; -import {Msg} from './msg.js'; -import {Names} from './names.js'; -import {IParameterModel} from './interfaces/i_parameter_model.js'; -import {IProcedureMap} from './interfaces/i_procedure_map.js'; -import {IProcedureModel} from './interfaces/i_procedure_model.js'; -import { - IProcedureBlock, - isProcedureBlock, -} from './interfaces/i_procedure_block.js'; +import {MutatorIcon} from './icons.js'; import { isLegacyProcedureCallBlock, isLegacyProcedureDefBlock, ProcedureBlock, ProcedureTuple, } from './interfaces/i_legacy_procedure_blocks.js'; +import {IParameterModel} from './interfaces/i_parameter_model.js'; +import { + IProcedureBlock, + isProcedureBlock, +} from './interfaces/i_procedure_block.js'; +import {IProcedureMap} from './interfaces/i_procedure_map.js'; +import {IProcedureModel} from './interfaces/i_procedure_model.js'; +import {Msg} from './msg.js'; +import {Names} from './names.js'; import {ObservableProcedureMap} from './observable_procedure_map.js'; import * as utilsXml from './utils/xml.js'; import * as Variables from './variables.js'; import type {Workspace} from './workspace.js'; import type {WorkspaceSvg} from './workspace_svg.js'; -import {MutatorIcon} from './icons.js'; /** * String for use in the "custom" attribute of a category in toolbox XML. @@ -500,11 +500,11 @@ export function getDefinition( } export { - ObservableProcedureMap, IParameterModel, IProcedureBlock, - isProcedureBlock, IProcedureMap, IProcedureModel, + isProcedureBlock, + ObservableProcedureMap, ProcedureTuple, }; diff --git a/core/registry.ts b/core/registry.ts index 39bb83b87..60e804979 100644 --- a/core/registry.ts +++ b/core/registry.ts @@ -8,11 +8,15 @@ import type {Abstract} from './events/events_abstract.js'; import type {Field} from './field.js'; -import type {IConnectionChecker} from './interfaces/i_connection_checker.js'; -import type {IFlyout} from './interfaces/i_flyout.js'; -import type {IMetricsManager} from './interfaces/i_metrics_manager.js'; -import type {IIcon} from './interfaces/i_icon.js'; import type {Input} from './inputs/input.js'; +import type {IConnectionChecker} from './interfaces/i_connection_checker.js'; +import type {IConnectionPreviewer} from './interfaces/i_connection_previewer.js'; +import type {ICopyData, ICopyable} from './interfaces/i_copyable.js'; +import type {IDragger} from './interfaces/i_dragger.js'; +import type {IFlyout} from './interfaces/i_flyout.js'; +import type {IIcon} from './interfaces/i_icon.js'; +import type {IMetricsManager} from './interfaces/i_metrics_manager.js'; +import type {IPaster} from './interfaces/i_paster.js'; import type {ISerializer} from './interfaces/i_serializer.js'; import type {IToolbox} from './interfaces/i_toolbox.js'; import type {Cursor} from './keyboard_nav/cursor.js'; @@ -20,10 +24,6 @@ import type {Options} from './options.js'; import type {Renderer} from './renderers/common/renderer.js'; import type {Theme} from './theme.js'; import type {ToolboxItem} from './toolbox/toolbox_item.js'; -import type {IPaster} from './interfaces/i_paster.js'; -import type {ICopyData, ICopyable} from './interfaces/i_copyable.js'; -import type {IConnectionPreviewer} from './interfaces/i_connection_previewer.js'; -import type {IDragger} from './interfaces/i_dragger.js'; /** * A map of maps. With the keys being the type and name of the class we are diff --git a/core/render_management.ts b/core/render_management.ts index 3e84efead..c3fe2e342 100644 --- a/core/render_management.ts +++ b/core/render_management.ts @@ -5,8 +5,8 @@ */ import {BlockSvg} from './block_svg.js'; -import * as userAgent from './utils/useragent.js'; import * as eventUtils from './events/utils.js'; +import * as userAgent from './utils/useragent.js'; import type {WorkspaceSvg} from './workspace_svg.js'; /** The set of all blocks in need of rendering which don't have parents. */ diff --git a/core/renderers/common/block_rendering.ts b/core/renderers/common/block_rendering.ts index 741e2367d..27fbbd538 100644 --- a/core/renderers/common/block_rendering.ts +++ b/core/renderers/common/block_rendering.ts @@ -30,7 +30,6 @@ import {SquareCorner} from '../measurables/square_corner.js'; import {StatementInput} from '../measurables/statement_input.js'; import {TopRow} from '../measurables/top_row.js'; import {Types} from '../measurables/types.js'; - import {Drawer} from './drawer.js'; import type {IPathObject} from './i_path_object.js'; import {RenderInfo} from './info.js'; @@ -81,43 +80,45 @@ export function init( renderer.init(theme, opt_rendererOverrides); return renderer; } -export {BottomRow}; -export {Connection}; -export {Drawer}; -export {ExternalValueInput}; -export {Field}; -export {Hat}; -export {Icon}; -export {InRowSpacer}; -export {InlineInput}; -export {InputConnection}; -export {InputRow}; -export {IPathObject}; -export {JaggedEdge}; -export {MarkerSvg}; -export {Measurable}; -export {NextConnection}; -export {OutputConnection}; -export {PathObject}; -export {PreviousConnection}; -export {Renderer}; -export {RenderInfo}; -export {RoundCorner}; -export {Row}; -export {SpacerRow}; -export {SquareCorner}; -export {StatementInput}; -export {TopRow}; -export {Types}; +export { + BottomRow, + Connection, + Drawer, + ExternalValueInput, + Field, + Hat, + Icon, + InlineInput, + InputConnection, + InputRow, + InRowSpacer, + IPathObject, + JaggedEdge, + MarkerSvg, + Measurable, + NextConnection, + OutputConnection, + PathObject, + PreviousConnection, + Renderer, + RenderInfo, + RoundCorner, + Row, + SpacerRow, + SquareCorner, + StatementInput, + TopRow, + Types, +}; export { - OutsideCorners, - InsideCorners, - StartHat, - Notch, - PuzzleTab, - JaggedTeeth, BaseShape, - DynamicShape, ConstantProvider, + DynamicShape, + InsideCorners, + JaggedTeeth, + Notch, + OutsideCorners, + PuzzleTab, + StartHat, } from './constants.js'; diff --git a/core/renderers/common/drawer.ts b/core/renderers/common/drawer.ts index 17d54eea5..59a856011 100644 --- a/core/renderers/common/drawer.ts +++ b/core/renderers/common/drawer.ts @@ -7,6 +7,7 @@ // Former goog.module ID: Blockly.blockRendering.Drawer import type {BlockSvg} from '../../block_svg.js'; +import {ConnectionType} from '../../connection_type.js'; import {Coordinate} from '../../utils.js'; import * as svgPaths from '../../utils/svg_paths.js'; import {Connection} from '../measurables/connection.js'; @@ -17,11 +18,9 @@ import type {InlineInput} from '../measurables/inline_input.js'; import type {PreviousConnection} from '../measurables/previous_connection.js'; import type {Row} from '../measurables/row.js'; import {Types} from '../measurables/types.js'; - -import {isDynamicShape, isNotch, isPuzzleTab} from './constants.js'; import type {ConstantProvider, Notch, PuzzleTab} from './constants.js'; +import {isDynamicShape, isNotch, isPuzzleTab} from './constants.js'; import type {RenderInfo} from './info.js'; -import {ConnectionType} from '../../connection_type.js'; /** * An object that draws a block based on the given rendering information. diff --git a/core/renderers/common/i_path_object.ts b/core/renderers/common/i_path_object.ts index 30033f18e..3a78035e1 100644 --- a/core/renderers/common/i_path_object.ts +++ b/core/renderers/common/i_path_object.ts @@ -6,11 +6,11 @@ // Former goog.module ID: Blockly.blockRendering.IPathObject -import type {BlockStyle} from '../../theme.js'; import type {BlockSvg} from '../../block_svg.js'; -import type {ConstantProvider} from './constants.js'; import type {RenderedConnection} from '../../rendered_connection.js'; +import type {BlockStyle} from '../../theme.js'; import type {Coordinate} from '../../utils/coordinate.js'; +import type {ConstantProvider} from './constants.js'; /** * An interface for a block's path object. diff --git a/core/renderers/common/info.ts b/core/renderers/common/info.ts index 995124c1b..ff073ace4 100644 --- a/core/renderers/common/info.ts +++ b/core/renderers/common/info.ts @@ -7,13 +7,16 @@ // Former goog.module ID: Blockly.blockRendering.RenderInfo import type {BlockSvg} from '../../block_svg.js'; -import {Input} from '../../inputs/input.js'; import {Align} from '../../inputs/align.js'; +import {DummyInput} from '../../inputs/dummy_input.js'; +import {EndRowInput} from '../../inputs/end_row_input.js'; +import {Input} from '../../inputs/input.js'; +import {StatementInput} from '../../inputs/statement_input.js'; +import {ValueInput} from '../../inputs/value_input.js'; import type {RenderedConnection} from '../../rendered_connection.js'; import type {Measurable} from '../measurables/base.js'; import {BottomRow} from '../measurables/bottom_row.js'; -import {DummyInput} from '../../inputs/dummy_input.js'; -import {EndRowInput} from '../../inputs/end_row_input.js'; +import {Connection} from '../measurables/connection.js'; import {ExternalValueInput} from '../measurables/external_value_input.js'; import {Field} from '../measurables/field.js'; import {Hat} from '../measurables/hat.js'; @@ -30,14 +33,10 @@ import type {Row} from '../measurables/row.js'; import {SpacerRow} from '../measurables/spacer_row.js'; import {SquareCorner} from '../measurables/square_corner.js'; import {StatementInput as StatementInputMeasurable} from '../measurables/statement_input.js'; -import {StatementInput} from '../../inputs/statement_input.js'; import {TopRow} from '../measurables/top_row.js'; import {Types} from '../measurables/types.js'; -import {ValueInput} from '../../inputs/value_input.js'; - import type {ConstantProvider} from './constants.js'; import type {Renderer} from './renderer.js'; -import {Connection} from '../measurables/connection.js'; /** * An object containing all sizing information needed to draw this block. diff --git a/core/renderers/common/marker_svg.ts b/core/renderers/common/marker_svg.ts index b2005012f..2eaee2aea 100644 --- a/core/renderers/common/marker_svg.ts +++ b/core/renderers/common/marker_svg.ts @@ -14,6 +14,7 @@ import type {Connection} from '../../connection.js'; import {ConnectionType} from '../../connection_type.js'; import * as eventUtils from '../../events/utils.js'; import type {Field} from '../../field.js'; +import {FlyoutButton} from '../../flyout_button.js'; import type {IASTNodeLocationSvg} from '../../interfaces/i_ast_node_location_svg.js'; import {ASTNode} from '../../keyboard_nav/ast_node.js'; import type {Marker} from '../../keyboard_nav/marker.js'; @@ -22,9 +23,7 @@ import * as dom from '../../utils/dom.js'; import {Svg} from '../../utils/svg.js'; import * as svgPaths from '../../utils/svg_paths.js'; import type {WorkspaceSvg} from '../../workspace_svg.js'; - import type {ConstantProvider, Notch, PuzzleTab} from './constants.js'; -import {FlyoutButton} from '../../flyout_button.js'; /** The name of the CSS class for a cursor. */ const CURSOR_CLASS = 'blocklyCursor'; diff --git a/core/renderers/common/path_object.ts b/core/renderers/common/path_object.ts index d5c0850a1..0f46cf3a4 100644 --- a/core/renderers/common/path_object.ts +++ b/core/renderers/common/path_object.ts @@ -13,7 +13,6 @@ import type {BlockStyle} from '../../theme.js'; import {Coordinate} from '../../utils/coordinate.js'; import * as dom from '../../utils/dom.js'; import {Svg} from '../../utils/svg.js'; - import type {ConstantProvider} from './constants.js'; import type {IPathObject} from './i_path_object.js'; diff --git a/core/renderers/common/renderer.ts b/core/renderers/common/renderer.ts index 15a958db4..d3bff56a7 100644 --- a/core/renderers/common/renderer.ts +++ b/core/renderers/common/renderer.ts @@ -18,15 +18,14 @@ import type {IRegistrable} from '../../interfaces/i_registrable.js'; import type {Marker} from '../../keyboard_nav/marker.js'; import type {RenderedConnection} from '../../rendered_connection.js'; import type {BlockStyle, Theme} from '../../theme.js'; +import * as deprecation from '../../utils/deprecation.js'; import type {WorkspaceSvg} from '../../workspace_svg.js'; - import {ConstantProvider} from './constants.js'; import {Drawer} from './drawer.js'; import type {IPathObject} from './i_path_object.js'; import {RenderInfo} from './info.js'; import {MarkerSvg} from './marker_svg.js'; import {PathObject} from './path_object.js'; -import * as deprecation from '../../utils/deprecation.js'; /** * The base class for a block renderer. diff --git a/core/renderers/geras/drawer.ts b/core/renderers/geras/drawer.ts index 29bcbfab4..542b21ff9 100644 --- a/core/renderers/geras/drawer.ts +++ b/core/renderers/geras/drawer.ts @@ -10,7 +10,6 @@ import type {BlockSvg} from '../../block_svg.js'; import * as svgPaths from '../../utils/svg_paths.js'; import {Drawer as BaseDrawer} from '../common/drawer.js'; import type {Row} from '../measurables/row.js'; - import type {ConstantProvider} from './constants.js'; import {Highlighter} from './highlighter.js'; import type {RenderInfo} from './info.js'; diff --git a/core/renderers/geras/highlighter.ts b/core/renderers/geras/highlighter.ts index 664e74fb8..efcb4e2df 100644 --- a/core/renderers/geras/highlighter.ts +++ b/core/renderers/geras/highlighter.ts @@ -13,7 +13,6 @@ import type {Row} from '../measurables/row.js'; import {SpacerRow} from '../measurables/spacer_row.js'; import type {TopRow} from '../measurables/top_row.js'; import {Types} from '../measurables/types.js'; - import type { HighlightConstantProvider, InsideCorner, diff --git a/core/renderers/geras/info.ts b/core/renderers/geras/info.ts index 6565f226b..b9cc1c59c 100644 --- a/core/renderers/geras/info.ts +++ b/core/renderers/geras/info.ts @@ -7,22 +7,21 @@ // Former goog.module ID: Blockly.geras.RenderInfo import type {BlockSvg} from '../../block_svg.js'; +import {DummyInput} from '../../inputs/dummy_input.js'; +import {EndRowInput} from '../../inputs/end_row_input.js'; import type {Input} from '../../inputs/input.js'; +import {StatementInput} from '../../inputs/statement_input.js'; +import {ValueInput} from '../../inputs/value_input.js'; import {RenderInfo as BaseRenderInfo} from '../common/info.js'; import type {Measurable} from '../measurables/base.js'; import type {BottomRow} from '../measurables/bottom_row.js'; -import {DummyInput} from '../../inputs/dummy_input.js'; -import {EndRowInput} from '../../inputs/end_row_input.js'; import {ExternalValueInput} from '../measurables/external_value_input.js'; import type {Field} from '../measurables/field.js'; import {InRowSpacer} from '../measurables/in_row_spacer.js'; import type {InputRow} from '../measurables/input_row.js'; import type {Row} from '../measurables/row.js'; -import {StatementInput} from '../../inputs/statement_input.js'; import type {TopRow} from '../measurables/top_row.js'; import {Types} from '../measurables/types.js'; -import {ValueInput} from '../../inputs/value_input.js'; - import type {ConstantProvider} from './constants.js'; import {InlineInput} from './measurables/inline_input.js'; import {StatementInput as StatementInputMeasurable} from './measurables/statement_input.js'; diff --git a/core/renderers/geras/measurables/inline_input.ts b/core/renderers/geras/measurables/inline_input.ts index 9ed85ad52..931b9e762 100644 --- a/core/renderers/geras/measurables/inline_input.ts +++ b/core/renderers/geras/measurables/inline_input.ts @@ -6,7 +6,6 @@ // Former goog.module ID: Blockly.geras.InlineInput -/* eslint-disable-next-line no-unused-vars */ import type {Input} from '../../../inputs/input.js'; import type {ConstantProvider as BaseConstantProvider} from '../../../renderers/common/constants.js'; import {InlineInput as BaseInlineInput} from '../../../renderers/measurables/inline_input.js'; diff --git a/core/renderers/geras/measurables/statement_input.ts b/core/renderers/geras/measurables/statement_input.ts index 5ce3f854a..c6eba8dc0 100644 --- a/core/renderers/geras/measurables/statement_input.ts +++ b/core/renderers/geras/measurables/statement_input.ts @@ -6,7 +6,6 @@ // Former goog.module ID: Blockly.geras.StatementInput -/* eslint-disable-next-line no-unused-vars */ import type {Input} from '../../../inputs/input.js'; import type {ConstantProvider as BaseConstantProvider} from '../../../renderers/common/constants.js'; import {StatementInput as BaseStatementInput} from '../../../renderers/measurables/statement_input.js'; diff --git a/core/renderers/geras/path_object.ts b/core/renderers/geras/path_object.ts index 6b058e5a7..c1d689535 100644 --- a/core/renderers/geras/path_object.ts +++ b/core/renderers/geras/path_object.ts @@ -12,7 +12,6 @@ import * as colour from '../../utils/colour.js'; import * as dom from '../../utils/dom.js'; import {Svg} from '../../utils/svg.js'; import {PathObject as BasePathObject} from '../common/path_object.js'; - import type {ConstantProvider} from './constants.js'; /** diff --git a/core/renderers/geras/renderer.ts b/core/renderers/geras/renderer.ts index 06062e9bc..aba8fc3ea 100644 --- a/core/renderers/geras/renderer.ts +++ b/core/renderers/geras/renderer.ts @@ -11,7 +11,6 @@ import type {BlockStyle, Theme} from '../../theme.js'; import * as blockRendering from '../common/block_rendering.js'; import type {RenderInfo as BaseRenderInfo} from '../common/info.js'; import {Renderer as BaseRenderer} from '../common/renderer.js'; - import {ConstantProvider} from './constants.js'; import {Drawer} from './drawer.js'; import {HighlightConstantProvider} from './highlight_constants.js'; diff --git a/core/renderers/measurables/base.ts b/core/renderers/measurables/base.ts index e429a3a3e..15f4f3683 100644 --- a/core/renderers/measurables/base.ts +++ b/core/renderers/measurables/base.ts @@ -7,7 +7,6 @@ // Former goog.module ID: Blockly.blockRendering.Measurable import type {ConstantProvider} from '../common/constants.js'; - import {Types} from './types.js'; /** diff --git a/core/renderers/measurables/bottom_row.ts b/core/renderers/measurables/bottom_row.ts index 66cbbd34e..2506610e7 100644 --- a/core/renderers/measurables/bottom_row.ts +++ b/core/renderers/measurables/bottom_row.ts @@ -8,7 +8,6 @@ import type {BlockSvg} from '../../block_svg.js'; import type {ConstantProvider} from '../common/constants.js'; - import type {NextConnection} from './next_connection.js'; import {Row} from './row.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/connection.ts b/core/renderers/measurables/connection.ts index 5744eaab4..c5a3e4ce0 100644 --- a/core/renderers/measurables/connection.ts +++ b/core/renderers/measurables/connection.ts @@ -6,10 +6,8 @@ // Former goog.module ID: Blockly.blockRendering.Connection -/* eslint-disable-next-line no-unused-vars */ import type {RenderedConnection} from '../../rendered_connection.js'; import type {ConstantProvider, Shape} from '../common/constants.js'; - import {Measurable} from './base.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/external_value_input.ts b/core/renderers/measurables/external_value_input.ts index 9b9dac15f..4dea75413 100644 --- a/core/renderers/measurables/external_value_input.ts +++ b/core/renderers/measurables/external_value_input.ts @@ -6,10 +6,8 @@ // Former goog.module ID: Blockly.blockRendering.ExternalValueInput -/* eslint-disable-next-line no-unused-vars */ import type {Input} from '../../inputs/input.js'; import type {ConstantProvider} from '../common/constants.js'; - import {InputConnection} from './input_connection.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/field.ts b/core/renderers/measurables/field.ts index 8d6c4d60b..2c080d2e3 100644 --- a/core/renderers/measurables/field.ts +++ b/core/renderers/measurables/field.ts @@ -6,11 +6,9 @@ // Former goog.module ID: Blockly.blockRendering.Field -/* eslint-disable-next-line no-unused-vars */ import type {Field as BlocklyField} from '../../field.js'; import type {Input} from '../../inputs/input.js'; import type {ConstantProvider} from '../common/constants.js'; - import {Measurable} from './base.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/hat.ts b/core/renderers/measurables/hat.ts index 2a0a50586..477a2095b 100644 --- a/core/renderers/measurables/hat.ts +++ b/core/renderers/measurables/hat.ts @@ -7,7 +7,6 @@ // Former goog.module ID: Blockly.blockRendering.Hat import type {ConstantProvider} from '../common/constants.js'; - import {Measurable} from './base.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/icon.ts b/core/renderers/measurables/icon.ts index 98e3f722d..424cc67be 100644 --- a/core/renderers/measurables/icon.ts +++ b/core/renderers/measurables/icon.ts @@ -6,10 +6,8 @@ // Former goog.module ID: Blockly.blockRendering.Icon -/* eslint-disable-next-line no-unused-vars */ import type {IIcon as BlocklyIcon} from '../../interfaces/i_icon.js'; import type {ConstantProvider} from '../common/constants.js'; - import {Measurable} from './base.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/in_row_spacer.ts b/core/renderers/measurables/in_row_spacer.ts index 19b9efa67..ec64e71a2 100644 --- a/core/renderers/measurables/in_row_spacer.ts +++ b/core/renderers/measurables/in_row_spacer.ts @@ -7,7 +7,6 @@ // Former goog.module ID: Blockly.blockRendering.InRowSpacer import type {ConstantProvider} from '../common/constants.js'; - import {Measurable} from './base.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/inline_input.ts b/core/renderers/measurables/inline_input.ts index 9738ddfc2..307daef8d 100644 --- a/core/renderers/measurables/inline_input.ts +++ b/core/renderers/measurables/inline_input.ts @@ -6,10 +6,8 @@ // Former goog.module ID: Blockly.blockRendering.InlineInput -/* eslint-disable-next-line no-unused-vars */ import type {Input} from '../../inputs/input.js'; import type {ConstantProvider} from '../common/constants.js'; - import {InputConnection} from './input_connection.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/input_connection.ts b/core/renderers/measurables/input_connection.ts index 69ac82d21..e4e265b4e 100644 --- a/core/renderers/measurables/input_connection.ts +++ b/core/renderers/measurables/input_connection.ts @@ -10,7 +10,6 @@ import type {BlockSvg} from '../../block_svg.js'; import type {Input} from '../../inputs/input.js'; import type {RenderedConnection} from '../../rendered_connection.js'; import type {ConstantProvider} from '../common/constants.js'; - import {Connection} from './connection.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/input_row.ts b/core/renderers/measurables/input_row.ts index 229975cfe..a9924246f 100644 --- a/core/renderers/measurables/input_row.ts +++ b/core/renderers/measurables/input_row.ts @@ -7,7 +7,6 @@ // Former goog.module ID: Blockly.blockRendering.InputRow import type {ConstantProvider} from '../common/constants.js'; - import {ExternalValueInput} from './external_value_input.js'; import {InputConnection} from './input_connection.js'; import {Row} from './row.js'; diff --git a/core/renderers/measurables/jagged_edge.ts b/core/renderers/measurables/jagged_edge.ts index a7711dc28..daca25121 100644 --- a/core/renderers/measurables/jagged_edge.ts +++ b/core/renderers/measurables/jagged_edge.ts @@ -7,7 +7,6 @@ // Former goog.module ID: Blockly.blockRendering.JaggedEdge import type {ConstantProvider} from '../common/constants.js'; - import {Measurable} from './base.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/next_connection.ts b/core/renderers/measurables/next_connection.ts index 50ac75ad2..ea22001ed 100644 --- a/core/renderers/measurables/next_connection.ts +++ b/core/renderers/measurables/next_connection.ts @@ -8,7 +8,6 @@ import type {RenderedConnection} from '../../rendered_connection.js'; import type {ConstantProvider} from '../common/constants.js'; - import {Connection} from './connection.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/output_connection.ts b/core/renderers/measurables/output_connection.ts index 4a3f995f4..1fa074949 100644 --- a/core/renderers/measurables/output_connection.ts +++ b/core/renderers/measurables/output_connection.ts @@ -8,7 +8,6 @@ import type {RenderedConnection} from '../../rendered_connection.js'; import type {ConstantProvider} from '../common/constants.js'; - import {Connection} from './connection.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/previous_connection.ts b/core/renderers/measurables/previous_connection.ts index 44ebeebfa..1314eb6a4 100644 --- a/core/renderers/measurables/previous_connection.ts +++ b/core/renderers/measurables/previous_connection.ts @@ -8,7 +8,6 @@ import type {RenderedConnection} from '../../rendered_connection.js'; import type {ConstantProvider} from '../common/constants.js'; - import {Connection} from './connection.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/round_corner.ts b/core/renderers/measurables/round_corner.ts index 37fc0fb98..60bbed707 100644 --- a/core/renderers/measurables/round_corner.ts +++ b/core/renderers/measurables/round_corner.ts @@ -7,7 +7,6 @@ // Former goog.module ID: Blockly.blockRendering.RoundCorner import type {ConstantProvider} from '../common/constants.js'; - import {Measurable} from './base.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/row.ts b/core/renderers/measurables/row.ts index 4208c84b7..613ec6ace 100644 --- a/core/renderers/measurables/row.ts +++ b/core/renderers/measurables/row.ts @@ -7,7 +7,6 @@ // Former goog.module ID: Blockly.blockRendering.Row import type {ConstantProvider} from '../common/constants.js'; - import type {Measurable} from './base.js'; import type {InRowSpacer} from './in_row_spacer.js'; import type {InputConnection} from './input_connection.js'; diff --git a/core/renderers/measurables/spacer_row.ts b/core/renderers/measurables/spacer_row.ts index 6fae98d87..0e49d3088 100644 --- a/core/renderers/measurables/spacer_row.ts +++ b/core/renderers/measurables/spacer_row.ts @@ -7,7 +7,6 @@ // Former goog.module ID: Blockly.blockRendering.SpacerRow import type {ConstantProvider} from '../common/constants.js'; - import {InRowSpacer} from './in_row_spacer.js'; import {Row} from './row.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/square_corner.ts b/core/renderers/measurables/square_corner.ts index 560f37b65..29749ac05 100644 --- a/core/renderers/measurables/square_corner.ts +++ b/core/renderers/measurables/square_corner.ts @@ -7,7 +7,6 @@ // Former goog.module ID: Blockly.blockRendering.SquareCorner import type {ConstantProvider} from '../common/constants.js'; - import {Measurable} from './base.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/statement_input.ts b/core/renderers/measurables/statement_input.ts index cdc7c6680..91fe5b64a 100644 --- a/core/renderers/measurables/statement_input.ts +++ b/core/renderers/measurables/statement_input.ts @@ -6,10 +6,8 @@ // Former goog.module ID: Blockly.blockRendering.StatementInput -/* eslint-disable-next-line no-unused-vars */ import type {Input} from '../../inputs/input.js'; import type {ConstantProvider} from '../common/constants.js'; - import {InputConnection} from './input_connection.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/top_row.ts b/core/renderers/measurables/top_row.ts index b14908606..b87ce4ad7 100644 --- a/core/renderers/measurables/top_row.ts +++ b/core/renderers/measurables/top_row.ts @@ -8,7 +8,6 @@ import type {BlockSvg} from '../../block_svg.js'; import type {ConstantProvider} from '../common/constants.js'; - import {Hat} from './hat.js'; import type {PreviousConnection} from './previous_connection.js'; import {Row} from './row.js'; diff --git a/core/renderers/thrasos/info.ts b/core/renderers/thrasos/info.ts index 789897209..23772a9af 100644 --- a/core/renderers/thrasos/info.ts +++ b/core/renderers/thrasos/info.ts @@ -15,7 +15,6 @@ import {InRowSpacer} from '../measurables/in_row_spacer.js'; import type {Row} from '../measurables/row.js'; import type {TopRow} from '../measurables/top_row.js'; import {Types} from '../measurables/types.js'; - import type {Renderer} from './renderer.js'; /** diff --git a/core/renderers/thrasos/renderer.ts b/core/renderers/thrasos/renderer.ts index 513cadc78..d12eaf941 100644 --- a/core/renderers/thrasos/renderer.ts +++ b/core/renderers/thrasos/renderer.ts @@ -9,7 +9,6 @@ import type {BlockSvg} from '../../block_svg.js'; import * as blockRendering from '../common/block_rendering.js'; import {Renderer as BaseRenderer} from '../common/renderer.js'; - import {RenderInfo} from './info.js'; /** diff --git a/core/renderers/zelos/constants.ts b/core/renderers/zelos/constants.ts index c50e66510..66ba6c958 100644 --- a/core/renderers/zelos/constants.ts +++ b/core/renderers/zelos/constants.ts @@ -13,8 +13,8 @@ import * as utilsColour from '../../utils/colour.js'; import * as dom from '../../utils/dom.js'; import {Svg} from '../../utils/svg.js'; import * as svgPaths from '../../utils/svg_paths.js'; -import {ConstantProvider as BaseConstantProvider} from '../common/constants.js'; import type {Shape} from '../common/constants.js'; +import {ConstantProvider as BaseConstantProvider} from '../common/constants.js'; /** An object containing sizing and path information about inside corners. */ export interface InsideCorners { diff --git a/core/renderers/zelos/drawer.ts b/core/renderers/zelos/drawer.ts index 009247aea..e5b91c1e6 100644 --- a/core/renderers/zelos/drawer.ts +++ b/core/renderers/zelos/drawer.ts @@ -17,7 +17,6 @@ import {OutputConnection} from '../measurables/output_connection.js'; import type {Row} from '../measurables/row.js'; import type {SpacerRow} from '../measurables/spacer_row.js'; import {Types} from '../measurables/types.js'; - import type {InsideCorners} from './constants.js'; import type {RenderInfo} from './info.js'; import type {StatementInput} from './measurables/inputs.js'; diff --git a/core/renderers/zelos/info.ts b/core/renderers/zelos/info.ts index 623f0a3b0..dd3702fe5 100644 --- a/core/renderers/zelos/info.ts +++ b/core/renderers/zelos/info.ts @@ -7,24 +7,23 @@ // Former goog.module ID: Blockly.zelos.RenderInfo import type {BlockSvg} from '../../block_svg.js'; -import {DummyInput} from '../../inputs/dummy_input.js'; -import {EndRowInput} from '../../inputs/end_row_input.js'; import {FieldImage} from '../../field_image.js'; import {FieldLabel} from '../../field_label.js'; import {FieldTextInput} from '../../field_textinput.js'; -import {Input} from '../../inputs/input.js'; import {Align} from '../../inputs/align.js'; +import {DummyInput} from '../../inputs/dummy_input.js'; +import {EndRowInput} from '../../inputs/end_row_input.js'; +import {Input} from '../../inputs/input.js'; +import {StatementInput} from '../../inputs/statement_input.js'; +import {ValueInput} from '../../inputs/value_input.js'; import {RenderInfo as BaseRenderInfo} from '../common/info.js'; import type {Measurable} from '../measurables/base.js'; import {Field} from '../measurables/field.js'; import {InRowSpacer} from '../measurables/in_row_spacer.js'; import {InputConnection} from '../measurables/input_connection.js'; -import {StatementInput} from '../../inputs/statement_input.js'; import type {Row} from '../measurables/row.js'; import type {SpacerRow} from '../measurables/spacer_row.js'; import {Types} from '../measurables/types.js'; -import {ValueInput} from '../../inputs/value_input.js'; - import type {ConstantProvider, InsideCorners} from './constants.js'; import {BottomRow} from './measurables/bottom_row.js'; import {StatementInput as StatementInputMeasurable} from './measurables/inputs.js'; diff --git a/core/renderers/zelos/marker_svg.ts b/core/renderers/zelos/marker_svg.ts index 4805e264b..395ece0b0 100644 --- a/core/renderers/zelos/marker_svg.ts +++ b/core/renderers/zelos/marker_svg.ts @@ -15,7 +15,6 @@ import {Svg} from '../../utils/svg.js'; import type {WorkspaceSvg} from '../../workspace_svg.js'; import type {ConstantProvider as BaseConstantProvider} from '../common/constants.js'; import {MarkerSvg as BaseMarkerSvg} from '../common/marker_svg.js'; - import type {ConstantProvider as ZelosConstantProvider} from './constants.js'; /** diff --git a/core/renderers/zelos/measurables/inputs.ts b/core/renderers/zelos/measurables/inputs.ts index d405574e0..98dd9f33e 100644 --- a/core/renderers/zelos/measurables/inputs.ts +++ b/core/renderers/zelos/measurables/inputs.ts @@ -6,7 +6,6 @@ // Former goog.module ID: Blockly.zelos.StatementInput -/* eslint-disable-next-line no-unused-vars */ import type {Input} from '../../../inputs/input.js'; import type {ConstantProvider} from '../../../renderers/common/constants.js'; import {StatementInput as BaseStatementInput} from '../../../renderers/measurables/statement_input.js'; diff --git a/core/renderers/zelos/path_object.ts b/core/renderers/zelos/path_object.ts index fdc6ab8a6..060190ee1 100644 --- a/core/renderers/zelos/path_object.ts +++ b/core/renderers/zelos/path_object.ts @@ -12,7 +12,6 @@ import type {BlockStyle} from '../../theme.js'; import * as dom from '../../utils/dom.js'; import {Svg} from '../../utils/svg.js'; import {PathObject as BasePathObject} from '../common/path_object.js'; - import type {ConstantProvider} from './constants.js'; /** diff --git a/core/renderers/zelos/renderer.ts b/core/renderers/zelos/renderer.ts index 354a3f35a..b48600a0b 100644 --- a/core/renderers/zelos/renderer.ts +++ b/core/renderers/zelos/renderer.ts @@ -12,17 +12,16 @@ import {InsertionMarkerManager} from '../../insertion_marker_manager.js'; import type {Marker} from '../../keyboard_nav/marker.js'; import type {RenderedConnection} from '../../rendered_connection.js'; import type {BlockStyle} from '../../theme.js'; +import * as deprecation from '../../utils/deprecation.js'; import type {WorkspaceSvg} from '../../workspace_svg.js'; import * as blockRendering from '../common/block_rendering.js'; import type {RenderInfo as BaseRenderInfo} from '../common/info.js'; import {Renderer as BaseRenderer} from '../common/renderer.js'; - import {ConstantProvider} from './constants.js'; import {Drawer} from './drawer.js'; import {RenderInfo} from './info.js'; import {MarkerSvg} from './marker_svg.js'; import {PathObject} from './path_object.js'; -import * as deprecation from '../../utils/deprecation.js'; /** * The zelos renderer. This renderer emulates Scratch-style and MakeCode-style diff --git a/core/serialization.ts b/core/serialization.ts index 8e159bb2b..3eb232a54 100644 --- a/core/serialization.ts +++ b/core/serialization.ts @@ -9,24 +9,24 @@ */ // Former goog.module ID: Blockly.serialization +import {ISerializer} from './interfaces/i_serializer.js'; import * as blocks from './serialization/blocks.js'; import * as exceptions from './serialization/exceptions.js'; import * as priorities from './serialization/priorities.js'; import * as procedures from './serialization/procedures.js'; import * as registry from './serialization/registry.js'; import * as variables from './serialization/variables.js'; -import * as workspaces from './serialization/workspaces.js'; import * as workspaceComments from './serialization/workspace_comments.js'; -import {ISerializer} from './interfaces/i_serializer.js'; +import * as workspaces from './serialization/workspaces.js'; export { blocks, exceptions, + ISerializer, priorities, procedures, registry, variables, - workspaces, workspaceComments, - ISerializer, + workspaces, }; diff --git a/core/serialization/blocks.ts b/core/serialization/blocks.ts index dbb58cffb..47960258f 100644 --- a/core/serialization/blocks.ts +++ b/core/serialization/blocks.ts @@ -15,11 +15,12 @@ import {inputTypes} from '../inputs/input_types.js'; import {isSerializable} from '../interfaces/i_serializable.js'; import type {ISerializer} from '../interfaces/i_serializer.js'; import * as registry from '../registry.js'; +import * as renderManagement from '../render_management.js'; import * as utilsXml from '../utils/xml.js'; +import {VariableModel} from '../variable_model.js'; +import * as Variables from '../variables.js'; import type {Workspace} from '../workspace.js'; import * as Xml from '../xml.js'; -import * as renderManagement from '../render_management.js'; - import { BadConnectionCheck, MissingBlockType, @@ -29,8 +30,6 @@ import { } from './exceptions.js'; import * as priorities from './priorities.js'; import * as serializationRegistry from './registry.js'; -import * as Variables from '../variables.js'; -import {VariableModel} from '../variable_model.js'; // TODO(#5160): Remove this once lint is fixed. /* eslint-disable no-use-before-define */ diff --git a/core/serialization/procedures.ts b/core/serialization/procedures.ts index c51a38c82..5e2dd0d28 100644 --- a/core/serialization/procedures.ts +++ b/core/serialization/procedures.ts @@ -7,8 +7,8 @@ import {IParameterModel} from '../interfaces/i_parameter_model.js'; import {IProcedureModel} from '../interfaces/i_procedure_model.js'; import type {ISerializer} from '../interfaces/i_serializer.js'; -import * as priorities from './priorities.js'; import type {Workspace} from '../workspace.js'; +import * as priorities from './priorities.js'; /** Represents the state of a procedure model. */ export interface State { diff --git a/core/serialization/variables.ts b/core/serialization/variables.ts index 69c6cda8c..b714401eb 100644 --- a/core/serialization/variables.ts +++ b/core/serialization/variables.ts @@ -8,7 +8,6 @@ import type {ISerializer} from '../interfaces/i_serializer.js'; import type {Workspace} from '../workspace.js'; - import * as priorities from './priorities.js'; import * as serializationRegistry from './registry.js'; diff --git a/core/serialization/workspace_comments.ts b/core/serialization/workspace_comments.ts index 525274e58..61d1127b3 100644 --- a/core/serialization/workspace_comments.ts +++ b/core/serialization/workspace_comments.ts @@ -4,14 +4,14 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {ISerializer} from '../interfaces/i_serializer.js'; -import {Workspace} from '../workspace.js'; -import * as priorities from './priorities.js'; import type {WorkspaceComment} from '../comments/workspace_comment.js'; import * as eventUtils from '../events/utils.js'; +import {ISerializer} from '../interfaces/i_serializer.js'; import {Coordinate} from '../utils/coordinate.js'; -import * as serializationRegistry from './registry.js'; import {Size} from '../utils/size.js'; +import {Workspace} from '../workspace.js'; +import * as priorities from './priorities.js'; +import * as serializationRegistry from './registry.js'; export interface State { id?: string; diff --git a/core/serialization/workspaces.ts b/core/serialization/workspaces.ts index 871060196..7206e3715 100644 --- a/core/serialization/workspaces.ts +++ b/core/serialization/workspaces.ts @@ -10,7 +10,6 @@ import * as eventUtils from '../events/utils.js'; import type {ISerializer} from '../interfaces/i_serializer.js'; import * as registry from '../registry.js'; import * as dom from '../utils/dom.js'; -// eslint-disable-next-line no-unused-vars import type {Workspace} from '../workspace.js'; import {WorkspaceSvg} from '../workspace_svg.js'; diff --git a/core/shortcut_items.ts b/core/shortcut_items.ts index 6a7e29d26..3a32b687f 100644 --- a/core/shortcut_items.ts +++ b/core/shortcut_items.ts @@ -9,16 +9,16 @@ import {BlockSvg} from './block_svg.js'; import * as clipboard from './clipboard.js'; import * as common from './common.js'; +import * as eventUtils from './events/utils.js'; import {Gesture} from './gesture.js'; import {ICopyData, isCopyable} from './interfaces/i_copyable.js'; import {isDeletable} from './interfaces/i_deletable.js'; -import {KeyboardShortcut, ShortcutRegistry} from './shortcut_registry.js'; -import {KeyCodes} from './utils/keycodes.js'; -import type {WorkspaceSvg} from './workspace_svg.js'; import {isDraggable} from './interfaces/i_draggable.js'; -import * as eventUtils from './events/utils.js'; +import {KeyboardShortcut, ShortcutRegistry} from './shortcut_registry.js'; import {Coordinate} from './utils/coordinate.js'; +import {KeyCodes} from './utils/keycodes.js'; import {Rect} from './utils/rect.js'; +import type {WorkspaceSvg} from './workspace_svg.js'; /** * Object holding the names of the default shortcut items. diff --git a/core/toolbox/category.ts b/core/toolbox/category.ts index 9fc2f8a6f..5bdeca223 100644 --- a/core/toolbox/category.ts +++ b/core/toolbox/category.ts @@ -16,6 +16,11 @@ import type {ICollapsibleToolboxItem} from '../interfaces/i_collapsible_toolbox_ import type {ISelectableToolboxItem} from '../interfaces/i_selectable_toolbox_item.js'; import type {IToolbox} from '../interfaces/i_toolbox.js'; import type {IToolboxItem} from '../interfaces/i_toolbox_item.js'; +import * as registry from '../registry.js'; +import * as aria from '../utils/aria.js'; +import * as colourUtils from '../utils/colour.js'; +import * as dom from '../utils/dom.js'; +import * as parsing from '../utils/parsing.js'; import type { CategoryInfo, DynamicCategoryInfo, @@ -24,13 +29,7 @@ import type { FlyoutItemInfoArray, StaticCategoryInfo, } from '../utils/toolbox.js'; -import * as registry from '../registry.js'; -import * as aria from '../utils/aria.js'; -import * as colourUtils from '../utils/colour.js'; -import * as dom from '../utils/dom.js'; -import * as parsing from '../utils/parsing.js'; import * as toolbox from '../utils/toolbox.js'; - import {ToolboxItem} from './toolbox_item.js'; /** diff --git a/core/toolbox/collapsible_category.ts b/core/toolbox/collapsible_category.ts index faea8edcb..e51db4f68 100644 --- a/core/toolbox/collapsible_category.ts +++ b/core/toolbox/collapsible_category.ts @@ -18,7 +18,6 @@ import * as registry from '../registry.js'; import * as aria from '../utils/aria.js'; import * as dom from '../utils/dom.js'; import * as toolbox from '../utils/toolbox.js'; - import {ToolboxCategory} from './category.js'; import {ToolboxSeparator} from './separator.js'; diff --git a/core/toolbox/separator.ts b/core/toolbox/separator.ts index ec003daf6..5e899054a 100644 --- a/core/toolbox/separator.ts +++ b/core/toolbox/separator.ts @@ -16,7 +16,6 @@ import type {IToolbox} from '../interfaces/i_toolbox.js'; import * as registry from '../registry.js'; import * as dom from '../utils/dom.js'; import type * as toolbox from '../utils/toolbox.js'; - import {ToolboxItem} from './toolbox_item.js'; /** diff --git a/core/toolbox/toolbox.ts b/core/toolbox/toolbox.ts index 578a62b0e..4e0f77207 100644 --- a/core/toolbox/toolbox.ts +++ b/core/toolbox/toolbox.ts @@ -12,8 +12,6 @@ // Former goog.module ID: Blockly.Toolbox // Unused import preserved for side-effects. Remove if unneeded. -import '../events/events_toolbox_item_select.js'; - import {BlockSvg} from '../block_svg.js'; import type {BlocklyOptions} from '../blockly_options.js'; import * as browserEvents from '../browser_events.js'; @@ -21,9 +19,11 @@ import * as common from '../common.js'; import {ComponentManager} from '../component_manager.js'; import * as Css from '../css.js'; import {DeleteArea} from '../delete_area.js'; +import '../events/events_toolbox_item_select.js'; import * as eventUtils from '../events/utils.js'; import type {IAutoHideable} from '../interfaces/i_autohideable.js'; import type {ICollapsibleToolboxItem} from '../interfaces/i_collapsible_toolbox_item.js'; +import {isDeletable} from '../interfaces/i_deletable.js'; import type {IDraggable} from '../interfaces/i_draggable.js'; import type {IFlyout} from '../interfaces/i_flyout.js'; import type {IKeyboardAccessible} from '../interfaces/i_keyboard_accessible.js'; @@ -43,7 +43,6 @@ import * as toolbox from '../utils/toolbox.js'; import type {WorkspaceSvg} from '../workspace_svg.js'; import type {ToolboxCategory} from './category.js'; import {CollapsibleToolboxCategory} from './collapsible_category.js'; -import {isDeletable} from '../interfaces/i_deletable.js'; /** * Class for a Toolbox. diff --git a/core/trashcan.ts b/core/trashcan.ts index d4629dcae..4083a4294 100644 --- a/core/trashcan.ts +++ b/core/trashcan.ts @@ -12,14 +12,13 @@ // Former goog.module ID: Blockly.Trashcan // Unused import preserved for side-effects. Remove if unneeded. -import './events/events_trashcan_open.js'; - import type {BlocklyOptions} from './blockly_options.js'; import * as browserEvents from './browser_events.js'; import {ComponentManager} from './component_manager.js'; import {DeleteArea} from './delete_area.js'; import type {Abstract} from './events/events_abstract.js'; import type {BlockDelete} from './events/events_block_delete.js'; +import './events/events_trashcan_open.js'; import * as eventUtils from './events/utils.js'; import type {IAutoHideable} from './interfaces/i_autohideable.js'; import type {IDraggable} from './interfaces/i_draggable.js'; @@ -35,8 +34,8 @@ import * as dom from './utils/dom.js'; import {Rect} from './utils/rect.js'; import {Size} from './utils/size.js'; import {Svg} from './utils/svg.js'; -import {BlockInfo} from './utils/toolbox.js'; import * as toolbox from './utils/toolbox.js'; +import {BlockInfo} from './utils/toolbox.js'; import type {WorkspaceSvg} from './workspace_svg.js'; /** diff --git a/core/utils/parsing.ts b/core/utils/parsing.ts index 9950b80e6..3f70f5693 100644 --- a/core/utils/parsing.ts +++ b/core/utils/parsing.ts @@ -7,7 +7,6 @@ // Former goog.module ID: Blockly.utils.parsing import {Msg} from '../msg.js'; - import * as colourUtils from './colour.js'; /** diff --git a/core/utils/svg_math.ts b/core/utils/svg_math.ts index 0444787ad..c29d6ae69 100644 --- a/core/utils/svg_math.ts +++ b/core/utils/svg_math.ts @@ -7,7 +7,6 @@ // Former goog.module ID: Blockly.utils.svgMath import type {WorkspaceSvg} from '../workspace_svg.js'; - import {Coordinate} from './coordinate.js'; import {Rect} from './rect.js'; import * as style from './style.js'; diff --git a/core/variables.ts b/core/variables.ts index dee53a72b..b69893a9f 100644 --- a/core/variables.ts +++ b/core/variables.ts @@ -8,9 +8,9 @@ import {Blocks} from './blocks.js'; import * as dialog from './dialog.js'; +import {isLegacyProcedureDefBlock} from './interfaces/i_legacy_procedure_blocks.js'; import {isVariableBackedParameterModel} from './interfaces/i_variable_backed_parameter_model.js'; import {Msg} from './msg.js'; -import {isLegacyProcedureDefBlock} from './interfaces/i_legacy_procedure_blocks.js'; import * as utilsXml from './utils/xml.js'; import {VariableModel} from './variable_model.js'; import type {Workspace} from './workspace.js'; diff --git a/core/variables_dynamic.ts b/core/variables_dynamic.ts index 6c4457549..9788962c7 100644 --- a/core/variables_dynamic.ts +++ b/core/variables_dynamic.ts @@ -7,13 +7,13 @@ // Former goog.module ID: Blockly.VariablesDynamic import {Blocks} from './blocks.js'; +import type {FlyoutButton} from './flyout_button.js'; import {Msg} from './msg.js'; import * as xml from './utils/xml.js'; import {VariableModel} from './variable_model.js'; import * as Variables from './variables.js'; import type {Workspace} from './workspace.js'; import type {WorkspaceSvg} from './workspace_svg.js'; -import type {FlyoutButton} from './flyout_button.js'; /** * String for use in the "custom" attribute of a category in toolbox XML. diff --git a/core/widgetdiv.ts b/core/widgetdiv.ts index b28ec6367..897698611 100644 --- a/core/widgetdiv.ts +++ b/core/widgetdiv.ts @@ -7,8 +7,8 @@ // Former goog.module ID: Blockly.WidgetDiv import * as common from './common.js'; -import * as dom from './utils/dom.js'; import {Field} from './field.js'; +import * as dom from './utils/dom.js'; import type {Rect} from './utils/rect.js'; import type {Size} from './utils/size.js'; import type {WorkspaceSvg} from './workspace_svg.js'; diff --git a/core/workspace.ts b/core/workspace.ts index d092cbc82..bf734243f 100644 --- a/core/workspace.ts +++ b/core/workspace.ts @@ -16,12 +16,15 @@ import './connection_checker.js'; import type {Block} from './block.js'; import type {BlocklyOptions} from './blockly_options.js'; +import {WorkspaceComment} from './comments/workspace_comment.js'; +import * as common from './common.js'; import type {ConnectionDB} from './connection_db.js'; import type {Abstract} from './events/events_abstract.js'; -import * as common from './common.js'; import * as eventUtils from './events/utils.js'; import type {IASTNodeLocation} from './interfaces/i_ast_node_location.js'; import type {IConnectionChecker} from './interfaces/i_connection_checker.js'; +import {IProcedureMap} from './interfaces/i_procedure_map.js'; +import {ObservableProcedureMap} from './observable_procedure_map.js'; import {Options} from './options.js'; import * as registry from './registry.js'; import * as arrayUtils from './utils/array.js'; @@ -30,9 +33,6 @@ import * as math from './utils/math.js'; import type * as toolbox from './utils/toolbox.js'; import {VariableMap} from './variable_map.js'; import type {VariableModel} from './variable_model.js'; -import {WorkspaceComment} from './comments/workspace_comment.js'; -import {IProcedureMap} from './interfaces/i_procedure_map.js'; -import {ObservableProcedureMap} from './observable_procedure_map.js'; /** * Class for a workspace. This is a data structure that contains blocks. diff --git a/core/workspace_svg.ts b/core/workspace_svg.ts index 82a08b237..6bf5fa5a5 100644 --- a/core/workspace_svg.ts +++ b/core/workspace_svg.ts @@ -22,11 +22,16 @@ import type {Block} from './block.js'; import type {BlockSvg} from './block_svg.js'; import type {BlocklyOptions} from './blockly_options.js'; import * as browserEvents from './browser_events.js'; +import {RenderedWorkspaceComment} from './comments/rendered_workspace_comment.js'; +import {WorkspaceComment} from './comments/workspace_comment.js'; import * as common from './common.js'; import {ComponentManager} from './component_manager.js'; import {ConnectionDB} from './connection_db.js'; import * as ContextMenu from './contextmenu.js'; -import {ContextMenuRegistry} from './contextmenu_registry.js'; +import { + ContextMenuOption, + ContextMenuRegistry, +} from './contextmenu_registry.js'; import * as dropDownDiv from './dropdowndiv.js'; import * as eventUtils from './events/utils.js'; import type {FlyoutButton} from './flyout_button.js'; @@ -40,10 +45,12 @@ import type {IMetricsManager} from './interfaces/i_metrics_manager.js'; import type {IToolbox} from './interfaces/i_toolbox.js'; import type {Cursor} from './keyboard_nav/cursor.js'; import type {Marker} from './keyboard_nav/marker.js'; +import {LayerManager} from './layer_manager.js'; import {MarkerManager} from './marker_manager.js'; import {Options} from './options.js'; import * as Procedures from './procedures.js'; import * as registry from './registry.js'; +import * as renderManagement from './render_management.js'; import * as blockRendering from './renderers/common/block_rendering.js'; import type {Renderer} from './renderers/common/renderer.js'; import type {ScrollbarPair} from './scrollbar_pair.js'; @@ -68,12 +75,7 @@ import * as VariablesDynamic from './variables_dynamic.js'; import * as WidgetDiv from './widgetdiv.js'; import {Workspace} from './workspace.js'; import {WorkspaceAudio} from './workspace_audio.js'; -import {WorkspaceComment} from './comments/workspace_comment.js'; import {ZoomControls} from './zoom_controls.js'; -import {ContextMenuOption} from './contextmenu_registry.js'; -import * as renderManagement from './render_management.js'; -import {LayerManager} from './layer_manager.js'; -import {RenderedWorkspaceComment} from './comments/rendered_workspace_comment.js'; /** Margin around the top/bottom/left/right after a zoomToFit call. */ const ZOOM_TO_FIT_MARGIN = 20; diff --git a/core/xml.ts b/core/xml.ts index bad381c5d..5e344c3db 100644 --- a/core/xml.ts +++ b/core/xml.ts @@ -8,12 +8,16 @@ import type {Block} from './block.js'; import type {BlockSvg} from './block_svg.js'; +import {RenderedWorkspaceComment} from './comments/rendered_workspace_comment.js'; +import {WorkspaceComment} from './comments/workspace_comment.js'; import type {Connection} from './connection.js'; import {MANUALLY_DISABLED} from './constants.js'; import * as eventUtils from './events/utils.js'; import type {Field} from './field.js'; import {IconType} from './icons/icon_types.js'; import {inputTypes} from './inputs/input_types.js'; +import * as renderManagement from './render_management.js'; +import {Coordinate} from './utils/coordinate.js'; import * as dom from './utils/dom.js'; import {Size} from './utils/size.js'; import * as utilsXml from './utils/xml.js'; @@ -21,10 +25,6 @@ import type {VariableModel} from './variable_model.js'; import * as Variables from './variables.js'; import type {Workspace} from './workspace.js'; import {WorkspaceSvg} from './workspace_svg.js'; -import * as renderManagement from './render_management.js'; -import {WorkspaceComment} from './comments/workspace_comment.js'; -import {RenderedWorkspaceComment} from './comments/rendered_workspace_comment.js'; -import {Coordinate} from './utils/coordinate.js'; /** * Encode a block tree as XML. diff --git a/generators/dart/dart_generator.ts b/generators/dart/dart_generator.ts index 222bbd41d..20feeda6f 100644 --- a/generators/dart/dart_generator.ts +++ b/generators/dart/dart_generator.ts @@ -11,13 +11,13 @@ // Former goog.module ID: Blockly.Dart -import * as Variables from '../../core/variables.js'; -import * as stringUtils from '../../core/utils/string.js'; import type {Block} from '../../core/block.js'; import {CodeGenerator} from '../../core/generator.js'; -import {Names, NameType} from '../../core/names.js'; -import type {Workspace} from '../../core/workspace.js'; import {inputTypes} from '../../core/inputs/input_types.js'; +import {Names, NameType} from '../../core/names.js'; +import * as stringUtils from '../../core/utils/string.js'; +import * as Variables from '../../core/variables.js'; +import type {Workspace} from '../../core/workspace.js'; /** * Order of operation ENUMs. diff --git a/generators/dart/lists.ts b/generators/dart/lists.ts index 4aaf39905..176b88dc4 100644 --- a/generators/dart/lists.ts +++ b/generators/dart/lists.ts @@ -10,10 +10,10 @@ // Former goog.module ID: Blockly.Dart.lists -import type {Block} from '../../core/block.js'; import type {CreateWithBlock} from '../../blocks/lists.js'; -import type {DartGenerator} from './dart_generator.js'; +import type {Block} from '../../core/block.js'; import {NameType} from '../../core/names.js'; +import type {DartGenerator} from './dart_generator.js'; import {Order} from './dart_generator.js'; // RESERVED WORDS: 'Math' diff --git a/generators/dart/loops.ts b/generators/dart/loops.ts index a6b6bb180..f2e6efab0 100644 --- a/generators/dart/loops.ts +++ b/generators/dart/loops.ts @@ -10,11 +10,11 @@ // Former goog.module ID: Blockly.Dart.loops -import * as stringUtils from '../../core/utils/string.js'; -import type {Block} from '../../core/block.js'; import type {ControlFlowInLoopBlock} from '../../blocks/loops.js'; -import type {DartGenerator} from './dart_generator.js'; +import type {Block} from '../../core/block.js'; import {NameType} from '../../core/names.js'; +import * as stringUtils from '../../core/utils/string.js'; +import type {DartGenerator} from './dart_generator.js'; import {Order} from './dart_generator.js'; export function controls_repeat_ext(block: Block, generator: DartGenerator) { diff --git a/generators/dart/procedures.ts b/generators/dart/procedures.ts index 0ecf6d210..8890e713c 100644 --- a/generators/dart/procedures.ts +++ b/generators/dart/procedures.ts @@ -10,8 +10,8 @@ // Former goog.module ID: Blockly.Dart.procedures -import type {Block} from '../../core/block.js'; import type {IfReturnBlock} from '../../blocks/procedures.js'; +import type {Block} from '../../core/block.js'; import type {DartGenerator} from './dart_generator.js'; import {Order} from './dart_generator.js'; diff --git a/generators/dart/text.ts b/generators/dart/text.ts index c141eaad0..c189c32cf 100644 --- a/generators/dart/text.ts +++ b/generators/dart/text.ts @@ -10,9 +10,9 @@ // Former goog.module ID: Blockly.Dart.texts +import type {JoinMutatorBlock} from '../../blocks/text.js'; import type {Block} from '../../core/block.js'; import type {DartGenerator} from './dart_generator.js'; -import type {JoinMutatorBlock} from '../../blocks/text.js'; import {Order} from './dart_generator.js'; // RESERVED WORDS: 'Html,Math' diff --git a/generators/javascript/javascript_generator.ts b/generators/javascript/javascript_generator.ts index 592563f91..a247ed5dd 100644 --- a/generators/javascript/javascript_generator.ts +++ b/generators/javascript/javascript_generator.ts @@ -11,13 +11,13 @@ // Former goog.module ID: Blockly.JavaScript -import * as Variables from '../../core/variables.js'; -import * as stringUtils from '../../core/utils/string.js'; import type {Block} from '../../core/block.js'; import {CodeGenerator} from '../../core/generator.js'; -import {Names, NameType} from '../../core/names.js'; -import type {Workspace} from '../../core/workspace.js'; import {inputTypes} from '../../core/inputs/input_types.js'; +import {Names, NameType} from '../../core/names.js'; +import * as stringUtils from '../../core/utils/string.js'; +import * as Variables from '../../core/variables.js'; +import type {Workspace} from '../../core/workspace.js'; /** * Order of operation ENUMs. diff --git a/generators/javascript/lists.ts b/generators/javascript/lists.ts index bbed5231b..7fd1887fb 100644 --- a/generators/javascript/lists.ts +++ b/generators/javascript/lists.ts @@ -10,10 +10,10 @@ // Former goog.module ID: Blockly.JavaScript.lists -import type {Block} from '../../core/block.js'; import type {CreateWithBlock} from '../../blocks/lists.js'; -import type {JavascriptGenerator} from './javascript_generator.js'; +import type {Block} from '../../core/block.js'; import {NameType} from '../../core/names.js'; +import type {JavascriptGenerator} from './javascript_generator.js'; import {Order} from './javascript_generator.js'; export function lists_create_empty( diff --git a/generators/javascript/loops.ts b/generators/javascript/loops.ts index 555e43ff1..2bc561582 100644 --- a/generators/javascript/loops.ts +++ b/generators/javascript/loops.ts @@ -10,11 +10,11 @@ // Former goog.module ID: Blockly.JavaScript.loops -import * as stringUtils from '../../core/utils/string.js'; -import type {Block} from '../../core/block.js'; import type {ControlFlowInLoopBlock} from '../../blocks/loops.js'; -import type {JavascriptGenerator} from './javascript_generator.js'; +import type {Block} from '../../core/block.js'; import {NameType} from '../../core/names.js'; +import * as stringUtils from '../../core/utils/string.js'; +import type {JavascriptGenerator} from './javascript_generator.js'; import {Order} from './javascript_generator.js'; export function controls_repeat_ext( diff --git a/generators/javascript/procedures.ts b/generators/javascript/procedures.ts index e0a055217..d4a2e2034 100644 --- a/generators/javascript/procedures.ts +++ b/generators/javascript/procedures.ts @@ -10,8 +10,8 @@ // Former goog.module ID: Blockly.JavaScript.procedures -import type {Block} from '../../core/block.js'; import type {IfReturnBlock} from '../../blocks/procedures.js'; +import type {Block} from '../../core/block.js'; import type {JavascriptGenerator} from './javascript_generator.js'; import {Order} from './javascript_generator.js'; diff --git a/generators/javascript/text.ts b/generators/javascript/text.ts index d31bdcf4b..f991bb28a 100644 --- a/generators/javascript/text.ts +++ b/generators/javascript/text.ts @@ -10,9 +10,9 @@ // Former goog.module ID: Blockly.JavaScript.texts +import type {JoinMutatorBlock} from '../../blocks/text.js'; import type {Block} from '../../core/block.js'; import type {JavascriptGenerator} from './javascript_generator.js'; -import type {JoinMutatorBlock} from '../../blocks/text.js'; import {Order} from './javascript_generator.js'; /** diff --git a/generators/lua.ts b/generators/lua.ts index 0cf81fb96..35ac570af 100644 --- a/generators/lua.ts +++ b/generators/lua.ts @@ -11,10 +11,10 @@ // Former goog.module ID: Blockly.Lua.all -import {LuaGenerator} from './lua/lua_generator.js'; import * as lists from './lua/lists.js'; import * as logic from './lua/logic.js'; import * as loops from './lua/loops.js'; +import {LuaGenerator} from './lua/lua_generator.js'; import * as math from './lua/math.js'; import * as procedures from './lua/procedures.js'; import * as text from './lua/text.js'; diff --git a/generators/lua/lists.ts b/generators/lua/lists.ts index 901ed88a6..f1f90cc4a 100644 --- a/generators/lua/lists.ts +++ b/generators/lua/lists.ts @@ -10,10 +10,10 @@ // Former goog.module ID: Blockly.Lua.lists -import type {Block} from '../../core/block.js'; import type {CreateWithBlock} from '../../blocks/lists.js'; -import type {LuaGenerator} from './lua_generator.js'; +import type {Block} from '../../core/block.js'; import {NameType} from '../../core/names.js'; +import type {LuaGenerator} from './lua_generator.js'; import {Order} from './lua_generator.js'; export function lists_create_empty( diff --git a/generators/lua/loops.ts b/generators/lua/loops.ts index 01474cd81..2c09f6279 100644 --- a/generators/lua/loops.ts +++ b/generators/lua/loops.ts @@ -10,11 +10,11 @@ // Former goog.module ID: Blockly.Lua.loops -import * as stringUtils from '../../core/utils/string.js'; -import type {Block} from '../../core/block.js'; import type {ControlFlowInLoopBlock} from '../../blocks/loops.js'; -import type {LuaGenerator} from './lua_generator.js'; +import type {Block} from '../../core/block.js'; import {NameType} from '../../core/names.js'; +import * as stringUtils from '../../core/utils/string.js'; +import type {LuaGenerator} from './lua_generator.js'; import {Order} from './lua_generator.js'; /** diff --git a/generators/lua/lua_generator.ts b/generators/lua/lua_generator.ts index 76517c77d..b753ff2c6 100644 --- a/generators/lua/lua_generator.ts +++ b/generators/lua/lua_generator.ts @@ -13,12 +13,12 @@ // Former goog.module ID: Blockly.Lua -import * as stringUtils from '../../core/utils/string.js'; import type {Block} from '../../core/block.js'; import {CodeGenerator} from '../../core/generator.js'; -import {Names} from '../../core/names.js'; -import type {Workspace} from '../../core/workspace.js'; import {inputTypes} from '../../core/inputs/input_types.js'; +import {Names} from '../../core/names.js'; +import * as stringUtils from '../../core/utils/string.js'; +import type {Workspace} from '../../core/workspace.js'; /** * Order of operation ENUMs. diff --git a/generators/lua/procedures.ts b/generators/lua/procedures.ts index 79dc58aa2..bd78ef7a6 100644 --- a/generators/lua/procedures.ts +++ b/generators/lua/procedures.ts @@ -10,8 +10,8 @@ // Former goog.module ID: Blockly.Lua.procedures -import type {Block} from '../../core/block.js'; import type {IfReturnBlock} from '../../blocks/procedures.js'; +import type {Block} from '../../core/block.js'; import type {LuaGenerator} from './lua_generator.js'; import {Order} from './lua_generator.js'; diff --git a/generators/lua/text.ts b/generators/lua/text.ts index 1c4a79a8e..47d9a2033 100644 --- a/generators/lua/text.ts +++ b/generators/lua/text.ts @@ -10,8 +10,8 @@ // Former goog.module ID: Blockly.Lua.texts -import type {Block} from '../../core/block.js'; import type {JoinMutatorBlock} from '../../blocks/text.js'; +import type {Block} from '../../core/block.js'; import type {LuaGenerator} from './lua_generator.js'; import {Order} from './lua_generator.js'; diff --git a/generators/php.ts b/generators/php.ts index 30a080866..69f6cda74 100644 --- a/generators/php.ts +++ b/generators/php.ts @@ -12,11 +12,11 @@ // Former goog.module ID: Blockly.PHP.all -import {PhpGenerator} from './php/php_generator.js'; import * as lists from './php/lists.js'; import * as logic from './php/logic.js'; import * as loops from './php/loops.js'; import * as math from './php/math.js'; +import {PhpGenerator} from './php/php_generator.js'; import * as procedures from './php/procedures.js'; import * as text from './php/text.js'; import * as variables from './php/variables.js'; diff --git a/generators/php/lists.ts b/generators/php/lists.ts index 7ca2639b7..009d7ccc8 100644 --- a/generators/php/lists.ts +++ b/generators/php/lists.ts @@ -21,12 +21,12 @@ // Former goog.module ID: Blockly.generator.lists -import * as stringUtils from '../../core/utils/string.js'; -import type {Block} from '../../core/block.js'; import type {CreateWithBlock} from '../../blocks/lists.js'; +import type {Block} from '../../core/block.js'; import {NameType} from '../../core/names.js'; -import {Order} from './php_generator.js'; +import * as stringUtils from '../../core/utils/string.js'; import type {PhpGenerator} from './php_generator.js'; +import {Order} from './php_generator.js'; export function lists_create_empty( block: Block, diff --git a/generators/php/logic.ts b/generators/php/logic.ts index 8aaa5c892..731fe5708 100644 --- a/generators/php/logic.ts +++ b/generators/php/logic.ts @@ -11,8 +11,8 @@ // Former goog.module ID: Blockly.PHP.logic import type {Block} from '../../core/block.js'; -import {Order} from './php_generator.js'; import type {PhpGenerator} from './php_generator.js'; +import {Order} from './php_generator.js'; export function controls_if(block: Block, generator: PhpGenerator) { // If/elseif/else condition. diff --git a/generators/php/loops.ts b/generators/php/loops.ts index ae87dbb29..991cbaf4e 100644 --- a/generators/php/loops.ts +++ b/generators/php/loops.ts @@ -10,12 +10,12 @@ // Former goog.module ID: Blockly.PHP.loops -import * as stringUtils from '../../core/utils/string.js'; -import type {Block} from '../../core/block.js'; import type {ControlFlowInLoopBlock} from '../../blocks/loops.js'; +import type {Block} from '../../core/block.js'; import {NameType} from '../../core/names.js'; -import {Order} from './php_generator.js'; +import * as stringUtils from '../../core/utils/string.js'; import type {PhpGenerator} from './php_generator.js'; +import {Order} from './php_generator.js'; export function controls_repeat_ext(block: Block, generator: PhpGenerator) { // Repeat n times. diff --git a/generators/php/math.ts b/generators/php/math.ts index 6218bf4d1..2026af064 100644 --- a/generators/php/math.ts +++ b/generators/php/math.ts @@ -11,8 +11,8 @@ // Former goog.module ID: Blockly.PHP.math import type {Block} from '../../core/block.js'; -import {Order} from './php_generator.js'; import type {PhpGenerator} from './php_generator.js'; +import {Order} from './php_generator.js'; export function math_number( block: Block, diff --git a/generators/php/php_generator.ts b/generators/php/php_generator.ts index ecdfb76fd..8ac23c057 100644 --- a/generators/php/php_generator.ts +++ b/generators/php/php_generator.ts @@ -11,12 +11,12 @@ // Former goog.module ID: Blockly.PHP -import * as stringUtils from '../../core/utils/string.js'; import type {Block} from '../../core/block.js'; import {CodeGenerator} from '../../core/generator.js'; -import {Names} from '../../core/names.js'; -import type {Workspace} from '../../core/workspace.js'; import {inputTypes} from '../../core/inputs/input_types.js'; +import {Names} from '../../core/names.js'; +import * as stringUtils from '../../core/utils/string.js'; +import type {Workspace} from '../../core/workspace.js'; /** * Order of operation ENUMs. diff --git a/generators/php/procedures.ts b/generators/php/procedures.ts index acf84aea6..bad6c1443 100644 --- a/generators/php/procedures.ts +++ b/generators/php/procedures.ts @@ -10,12 +10,12 @@ // Former goog.module ID: Blockly.PHP.procedures -import * as Variables from '../../core/variables.js'; -import type {Block} from '../../core/block.js'; import type {IfReturnBlock} from '../../blocks/procedures.js'; +import type {Block} from '../../core/block.js'; import {NameType} from '../../core/names.js'; -import {Order} from './php_generator.js'; +import * as Variables from '../../core/variables.js'; import type {PhpGenerator} from './php_generator.js'; +import {Order} from './php_generator.js'; export function procedures_defreturn(block: Block, generator: PhpGenerator) { // Define a procedure with a return value. diff --git a/generators/php/text.ts b/generators/php/text.ts index 811e0251f..f50c76946 100644 --- a/generators/php/text.ts +++ b/generators/php/text.ts @@ -10,10 +10,10 @@ // Former goog.module ID: Blockly.PHP.texts -import type {Block} from '../../core/block.js'; import type {JoinMutatorBlock} from '../../blocks/text.js'; -import {Order} from './php_generator.js'; +import type {Block} from '../../core/block.js'; import type {PhpGenerator} from './php_generator.js'; +import {Order} from './php_generator.js'; export function text(block: Block, generator: PhpGenerator): [string, Order] { // Text value. diff --git a/generators/php/variables.ts b/generators/php/variables.ts index 4aacc293b..2275719da 100644 --- a/generators/php/variables.ts +++ b/generators/php/variables.ts @@ -11,8 +11,8 @@ // Former goog.module ID: Blockly.PHP.variables import type {Block} from '../../core/block.js'; -import {Order} from './php_generator.js'; import type {PhpGenerator} from './php_generator.js'; +import {Order} from './php_generator.js'; export function variables_get( block: Block, diff --git a/generators/python.ts b/generators/python.ts index d7b505763..6d57229e3 100644 --- a/generators/python.ts +++ b/generators/python.ts @@ -12,12 +12,12 @@ // Former goog.module ID: Blockly.Python.all -import {PythonGenerator} from './python/python_generator.js'; import * as lists from './python/lists.js'; import * as logic from './python/logic.js'; import * as loops from './python/loops.js'; import * as math from './python/math.js'; import * as procedures from './python/procedures.js'; +import {PythonGenerator} from './python/python_generator.js'; import * as text from './python/text.js'; import * as variables from './python/variables.js'; import * as variablesDynamic from './python/variables_dynamic.js'; diff --git a/generators/python/lists.ts b/generators/python/lists.ts index 6e412c23f..79cfe9dd8 100644 --- a/generators/python/lists.ts +++ b/generators/python/lists.ts @@ -10,12 +10,12 @@ // Former goog.module ID: Blockly.Python.lists -import * as stringUtils from '../../core/utils/string.js'; -import type {Block} from '../../core/block.js'; import type {CreateWithBlock} from '../../blocks/lists.js'; +import type {Block} from '../../core/block.js'; import {NameType} from '../../core/names.js'; -import {Order} from './python_generator.js'; +import * as stringUtils from '../../core/utils/string.js'; import type {PythonGenerator} from './python_generator.js'; +import {Order} from './python_generator.js'; export function lists_create_empty( block: Block, diff --git a/generators/python/loops.ts b/generators/python/loops.ts index 7ca7a5582..84aa613c6 100644 --- a/generators/python/loops.ts +++ b/generators/python/loops.ts @@ -10,11 +10,11 @@ // Former goog.module ID: Blockly.Python.loops -import * as stringUtils from '../../core/utils/string.js'; -import type {Block} from '../../core/block.js'; import type {ControlFlowInLoopBlock} from '../../blocks/loops.js'; -import type {PythonGenerator} from './python_generator.js'; +import type {Block} from '../../core/block.js'; import {NameType} from '../../core/names.js'; +import * as stringUtils from '../../core/utils/string.js'; +import type {PythonGenerator} from './python_generator.js'; import {Order} from './python_generator.js'; export function controls_repeat_ext(block: Block, generator: PythonGenerator) { diff --git a/generators/python/procedures.ts b/generators/python/procedures.ts index 51d2ee9a3..32eae97b9 100644 --- a/generators/python/procedures.ts +++ b/generators/python/procedures.ts @@ -10,12 +10,12 @@ // Former goog.module ID: Blockly.Python.procedures -import * as Variables from '../../core/variables.js'; -import type {Block} from '../../core/block.js'; import type {IfReturnBlock} from '../../blocks/procedures.js'; +import type {Block} from '../../core/block.js'; import {NameType} from '../../core/names.js'; -import {Order} from './python_generator.js'; +import * as Variables from '../../core/variables.js'; import type {PythonGenerator} from './python_generator.js'; +import {Order} from './python_generator.js'; export function procedures_defreturn(block: Block, generator: PythonGenerator) { // Define a procedure with a return value. diff --git a/generators/python/python_generator.ts b/generators/python/python_generator.ts index bf7b87496..f96312e6d 100644 --- a/generators/python/python_generator.ts +++ b/generators/python/python_generator.ts @@ -11,13 +11,13 @@ // Former goog.module ID: Blockly.Python -import * as stringUtils from '../../core/utils/string.js'; -import * as Variables from '../../core/variables.js'; import type {Block} from '../../core/block.js'; import {CodeGenerator} from '../../core/generator.js'; -import {Names} from '../../core/names.js'; -import type {Workspace} from '../../core/workspace.js'; import {inputTypes} from '../../core/inputs/input_types.js'; +import {Names} from '../../core/names.js'; +import * as stringUtils from '../../core/utils/string.js'; +import * as Variables from '../../core/variables.js'; +import type {Workspace} from '../../core/workspace.js'; /** * Order of operation ENUMs. diff --git a/generators/python/text.ts b/generators/python/text.ts index e9154da83..1ccf6b200 100644 --- a/generators/python/text.ts +++ b/generators/python/text.ts @@ -10,12 +10,12 @@ // Former goog.module ID: Blockly.Python.texts -import * as stringUtils from '../../core/utils/string.js'; -import type {Block} from '../../core/block.js'; import type {JoinMutatorBlock} from '../../blocks/text.js'; +import type {Block} from '../../core/block.js'; import {NameType} from '../../core/names.js'; -import {Order} from './python_generator.js'; +import * as stringUtils from '../../core/utils/string.js'; import type {PythonGenerator} from './python_generator.js'; +import {Order} from './python_generator.js'; export function text( block: Block, diff --git a/package-lock.json b/package-lock.json index 227a27031..788993d05 100644 --- a/package-lock.json +++ b/package-lock.json @@ -48,6 +48,7 @@ "mocha": "^10.0.0", "patch-package": "^8.0.0", "prettier": "^3.3.3", + "prettier-plugin-organize-imports": "^4.0.0", "readline-sync": "^1.4.10", "rimraf": "^5.0.0", "typescript": "^5.3.3", @@ -7565,6 +7566,27 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/prettier-plugin-organize-imports": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-4.0.0.tgz", + "integrity": "sha512-vnKSdgv9aOlqKeEFGhf9SCBsTyzDSyScy1k7E0R1Uo4L0cTcOV7c1XQaT7jfXIOc/p08WLBfN2QUQA9zDSZMxA==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@vue/language-plugin-pug": "^2.0.24", + "prettier": ">=2.0", + "typescript": ">=2.9", + "vue-tsc": "^2.0.24" + }, + "peerDependenciesMeta": { + "@vue/language-plugin-pug": { + "optional": true + }, + "vue-tsc": { + "optional": true + } + } + }, "node_modules/process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", diff --git a/package.json b/package.json index 3fc0a69e1..fa7ab7163 100644 --- a/package.json +++ b/package.json @@ -135,6 +135,7 @@ "mocha": "^10.0.0", "patch-package": "^8.0.0", "prettier": "^3.3.3", + "prettier-plugin-organize-imports": "^4.0.0", "readline-sync": "^1.4.10", "rimraf": "^5.0.0", "typescript": "^5.3.3", diff --git a/tests/browser/test/basic_block_factory_test.mjs b/tests/browser/test/basic_block_factory_test.mjs index e20892471..a9f3cc3f3 100644 --- a/tests/browser/test/basic_block_factory_test.mjs +++ b/tests/browser/test/basic_block_factory_test.mjs @@ -9,7 +9,7 @@ */ import * as chai from 'chai'; -import {testSetup, testFileLocations} from './test_setup.mjs'; +import {testFileLocations, testSetup} from './test_setup.mjs'; suite('Testing Connecting Blocks', function (done) { // Setting timeout to unlimited as the webdriver takes a longer time to run than most mocha test diff --git a/tests/browser/test/basic_block_test.mjs b/tests/browser/test/basic_block_test.mjs index 515cf5668..326e20ecf 100644 --- a/tests/browser/test/basic_block_test.mjs +++ b/tests/browser/test/basic_block_test.mjs @@ -11,12 +11,11 @@ import * as chai from 'chai'; import { - testSetup, - testFileLocations, - getAllBlocks, dragNthBlockFromFlyout, + getAllBlocks, + testFileLocations, + testSetup, } from './test_setup.mjs'; -import {Key} from 'webdriverio'; suite('Basic block tests', function (done) { // Setting timeout to unlimited as the webdriver takes a longer time diff --git a/tests/browser/test/basic_playground_test.mjs b/tests/browser/test/basic_playground_test.mjs index 11ad7a368..55ff58e4b 100644 --- a/tests/browser/test/basic_playground_test.mjs +++ b/tests/browser/test/basic_playground_test.mjs @@ -10,13 +10,13 @@ import * as chai from 'chai'; import { - testSetup, - testFileLocations, - dragNthBlockFromFlyout, - dragBlockTypeFromFlyout, connect, contextMenuSelect, + dragBlockTypeFromFlyout, + dragNthBlockFromFlyout, PAUSE_TIME, + testFileLocations, + testSetup, } from './test_setup.mjs'; async function getIsCollapsed(browser, blockId) { diff --git a/tests/browser/test/block_undo_test.mjs b/tests/browser/test/block_undo_test.mjs index 1c96422dc..0d9f256c2 100644 --- a/tests/browser/test/block_undo_test.mjs +++ b/tests/browser/test/block_undo_test.mjs @@ -11,11 +11,11 @@ import * as chai from 'chai'; import {Key} from 'webdriverio'; import { - testSetup, - testFileLocations, dragBlockTypeFromFlyout, - screenDirection, getAllBlocks, + screenDirection, + testFileLocations, + testSetup, } from './test_setup.mjs'; suite('Testing undo block movement', function (done) { diff --git a/tests/browser/test/delete_blocks_test.mjs b/tests/browser/test/delete_blocks_test.mjs index 1e560dcce..27e17054d 100644 --- a/tests/browser/test/delete_blocks_test.mjs +++ b/tests/browser/test/delete_blocks_test.mjs @@ -5,16 +5,16 @@ */ import * as chai from 'chai'; +import {Key} from 'webdriverio'; import { - testSetup, - testFileLocations, - getAllBlocks, - getBlockElementById, clickBlock, contextMenuSelect, + getAllBlocks, + getBlockElementById, PAUSE_TIME, + testFileLocations, + testSetup, } from './test_setup.mjs'; -import {Key} from 'webdriverio'; const firstBlockId = 'root_block'; const startBlocks = { diff --git a/tests/browser/test/extensive_test.mjs b/tests/browser/test/extensive_test.mjs index 2b1245d2a..786be0ade 100644 --- a/tests/browser/test/extensive_test.mjs +++ b/tests/browser/test/extensive_test.mjs @@ -9,14 +9,14 @@ */ import * as chai from 'chai'; -import { - testSetup, - testFileLocations, - getBlockElementById, - getAllBlocks, - PAUSE_TIME, -} from './test_setup.mjs'; import {Key} from 'webdriverio'; +import { + getAllBlocks, + getBlockElementById, + PAUSE_TIME, + testFileLocations, + testSetup, +} from './test_setup.mjs'; suite('This tests loading Large Configuration and Deletion', function (done) { // Setting timeout to unlimited as the webdriver takes a longer time to run than most mocha test diff --git a/tests/browser/test/field_edits_test.mjs b/tests/browser/test/field_edits_test.mjs index a4dbbb823..bd4da0019 100644 --- a/tests/browser/test/field_edits_test.mjs +++ b/tests/browser/test/field_edits_test.mjs @@ -9,14 +9,14 @@ */ import * as chai from 'chai'; +import {Key} from 'webdriverio'; import { - testSetup, - testFileLocations, + clickWorkspace, dragBlockTypeFromFlyout, screenDirection, - clickWorkspace, + testFileLocations, + testSetup, } from './test_setup.mjs'; -import {Key} from 'webdriverio'; suite('Testing Field Edits', function (done) { // Setting timeout to unlimited as the webdriver takes a longer time to run than most mocha test diff --git a/tests/browser/test/mutator_test.mjs b/tests/browser/test/mutator_test.mjs index 46bc2abbe..6d077b9fd 100644 --- a/tests/browser/test/mutator_test.mjs +++ b/tests/browser/test/mutator_test.mjs @@ -6,15 +6,15 @@ import * as chai from 'chai'; import { - testSetup, - testFileLocations, - connect, - dragBlockTypeFromFlyout, - screenDirection, PAUSE_TIME, - getBlockElementById, + connect, dragBlockFromMutatorFlyout, + dragBlockTypeFromFlyout, + getBlockElementById, openMutatorForBlock, + screenDirection, + testFileLocations, + testSetup, } from './test_setup.mjs'; suite('Mutating a block', function (done) { diff --git a/tests/browser/test/procedure_test.mjs b/tests/browser/test/procedure_test.mjs index 4c0e0897c..34368c732 100644 --- a/tests/browser/test/procedure_test.mjs +++ b/tests/browser/test/procedure_test.mjs @@ -10,13 +10,13 @@ import * as chai from 'chai'; import { - testSetup, - testFileLocations, - getSelectedBlockElement, - getNthBlockOfCategory, - getBlockTypeFromCategory, connect, + getBlockTypeFromCategory, + getNthBlockOfCategory, + getSelectedBlockElement, PAUSE_TIME, + testFileLocations, + testSetup, } from './test_setup.mjs'; suite('Testing Connecting Blocks', function (done) { diff --git a/tests/browser/test/test_setup.mjs b/tests/browser/test/test_setup.mjs index 3888815df..523a5d851 100644 --- a/tests/browser/test/test_setup.mjs +++ b/tests/browser/test/test_setup.mjs @@ -16,9 +16,9 @@ * identifiers that Selenium can use to find those elements. */ -import * as webdriverio from 'webdriverio'; import * as path from 'path'; import {fileURLToPath} from 'url'; +import * as webdriverio from 'webdriverio'; import {posixPath} from '../../../scripts/helpers.js'; let driver = null; diff --git a/tests/browser/test/toolbox_drag_test.mjs b/tests/browser/test/toolbox_drag_test.mjs index 47a352042..742872d93 100644 --- a/tests/browser/test/toolbox_drag_test.mjs +++ b/tests/browser/test/toolbox_drag_test.mjs @@ -10,12 +10,12 @@ import * as chai from 'chai'; import { - testSetup, - testFileLocations, getCategory, - scrollFlyout, - screenDirection, PAUSE_TIME, + screenDirection, + scrollFlyout, + testFileLocations, + testSetup, } from './test_setup.mjs'; // Categories in the basic toolbox. diff --git a/tests/browser/test/workspace_comment_test.mjs b/tests/browser/test/workspace_comment_test.mjs index 0a7b12bf7..5719948d0 100644 --- a/tests/browser/test/workspace_comment_test.mjs +++ b/tests/browser/test/workspace_comment_test.mjs @@ -6,8 +6,7 @@ import * as chai from 'chai'; import * as sinon from 'sinon'; -import {Key} from 'webdriverio'; -import {testSetup, testFileLocations} from './test_setup.mjs'; +import {testFileLocations, testSetup} from './test_setup.mjs'; suite('Workspace comments', function () { // Setting timeout to unlimited as the webdriver takes a longer time diff --git a/tests/migration/validate-renamings.mjs b/tests/migration/validate-renamings.mjs index 439e216c8..d9c66ef9c 100755 --- a/tests/migration/validate-renamings.mjs +++ b/tests/migration/validate-renamings.mjs @@ -11,11 +11,10 @@ * (renamings-schema.json). */ -import JSON5 from 'json5'; -import {readFile} from 'fs/promises'; -import {posixPath} from '../../scripts/helpers.js'; import {validate} from '@hyperjump/json-schema/draft-2020-12'; import {BASIC} from '@hyperjump/json-schema/experimental'; +import {readFile} from 'fs/promises'; +import JSON5 from 'json5'; /** @type {URL} Renaming schema filename. */ const SCHEMA_URL = new URL('renamings.schema.json', import.meta.url); diff --git a/tests/mocha/astnode_test.js b/tests/mocha/astnode_test.js index 4c449b7fa..7ffe8efb9 100644 --- a/tests/mocha/astnode_test.js +++ b/tests/mocha/astnode_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import {ASTNode} from '../../build/src/core/keyboard_nav/ast_node.js'; +import {assert} from '../../node_modules/chai/chai.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/block_json_test.js b/tests/mocha/block_json_test.js index 9d6dfb738..6f286fa30 100644 --- a/tests/mocha/block_json_test.js +++ b/tests/mocha/block_json_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import {Align} from '../../build/src/core/inputs/align.js'; +import {assert} from '../../node_modules/chai/chai.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/block_test.js b/tests/mocha/block_test.js index dd070f86c..1b685a445 100644 --- a/tests/mocha/block_test.js +++ b/tests/mocha/block_test.js @@ -4,23 +4,21 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import {ConnectionType} from '../../build/src/core/connection_type.js'; -import {createDeprecationWarningStub} from './test_helpers/warnings.js'; -import {createRenderedBlock} from './test_helpers/block_definitions.js'; import * as eventUtils from '../../build/src/core/events/utils.js'; import {EndRowInput} from '../../build/src/core/inputs/end_row_input.js'; +import {assert} from '../../node_modules/chai/chai.js'; +import {createRenderedBlock} from './test_helpers/block_definitions.js'; +import { + createChangeListenerSpy, + createMockEvent, +} from './test_helpers/events.js'; +import {MockBubbleIcon, MockIcon} from './test_helpers/icon_mocks.js'; import { sharedTestSetup, sharedTestTeardown, workspaceTeardown, } from './test_helpers/setup_teardown.js'; -import { - createChangeListenerSpy, - createMockEvent, -} from './test_helpers/events.js'; -import {MockIcon, MockBubbleIcon} from './test_helpers/icon_mocks.js'; -import {IconType} from '../../build/src/core/icons/icon_types.js'; suite('Blocks', function () { setup(function () { diff --git a/tests/mocha/blocks/lists_test.js b/tests/mocha/blocks/lists_test.js index cecf3c808..0c7a92bf6 100644 --- a/tests/mocha/blocks/lists_test.js +++ b/tests/mocha/blocks/lists_test.js @@ -4,14 +4,14 @@ * SPDX-License-Identifier: Apache-2.0 */ +import {ConnectionType} from '../../../build/src/core/connection_type.js'; import {assert} from '../../../node_modules/chai/chai.js'; +import {defineStatementBlock} from '../test_helpers/block_definitions.js'; import {runSerializationTestSuite} from '../test_helpers/serialization.js'; import { sharedTestSetup, sharedTestTeardown, } from '../test_helpers/setup_teardown.js'; -import {ConnectionType} from '../../../build/src/core/connection_type.js'; -import {defineStatementBlock} from '../test_helpers/block_definitions.js'; suite('Lists', function () { setup(function () { diff --git a/tests/mocha/blocks/logic_ternary_test.js b/tests/mocha/blocks/logic_ternary_test.js index 6661bd5d4..e6e3326ec 100644 --- a/tests/mocha/blocks/logic_ternary_test.js +++ b/tests/mocha/blocks/logic_ternary_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../../node_modules/chai/chai.js'; import * as eventUtils from '../../../build/src/core/events/utils.js'; +import {assert} from '../../../node_modules/chai/chai.js'; import {runSerializationTestSuite} from '../test_helpers/serialization.js'; import { sharedTestSetup, diff --git a/tests/mocha/blocks/loops_test.js b/tests/mocha/blocks/loops_test.js index 8f4897e00..f8d74916c 100644 --- a/tests/mocha/blocks/loops_test.js +++ b/tests/mocha/blocks/loops_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../../node_modules/chai/chai.js'; import * as Blockly from '../../../build/src/core/blockly.js'; +import {assert} from '../../../node_modules/chai/chai.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/blocks/procedures_test.js b/tests/mocha/blocks/procedures_test.js index 600aefa6a..84dbf1746 100644 --- a/tests/mocha/blocks/procedures_test.js +++ b/tests/mocha/blocks/procedures_test.js @@ -4,13 +4,14 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../../node_modules/chai/chai.js'; import * as Blockly from '../../../build/src/core/blockly.js'; +import {assert} from '../../../node_modules/chai/chai.js'; +import {defineRowBlock} from '../test_helpers/block_definitions.js'; import { assertCallBlockStructure, assertDefBlockStructure, - createProcDefBlock, createProcCallBlock, + createProcDefBlock, MockProcedureModel, } from '../test_helpers/procedures.js'; import {runSerializationTestSuite} from '../test_helpers/serialization.js'; @@ -20,7 +21,6 @@ import { sharedTestTeardown, workspaceTeardown, } from '../test_helpers/setup_teardown.js'; -import {defineRowBlock} from '../test_helpers/block_definitions.js'; suite('Procedures', function () { setup(function () { diff --git a/tests/mocha/blocks/variables_test.js b/tests/mocha/blocks/variables_test.js index ea45d59c3..d12691dd4 100644 --- a/tests/mocha/blocks/variables_test.js +++ b/tests/mocha/blocks/variables_test.js @@ -4,16 +4,16 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../../node_modules/chai/chai.js'; -import { - sharedTestSetup, - sharedTestTeardown, -} from '../test_helpers/setup_teardown.js'; import {nameUsedWithConflictingParam} from '../../../build/src/core/variables.js'; +import {assert} from '../../../node_modules/chai/chai.js'; import { MockParameterModelWithVar, MockProcedureModel, } from '../test_helpers/procedures.js'; +import { + sharedTestSetup, + sharedTestTeardown, +} from '../test_helpers/setup_teardown.js'; suite('Variables', function () { setup(function () { diff --git a/tests/mocha/clipboard_test.js b/tests/mocha/clipboard_test.js index 37145de07..652698421 100644 --- a/tests/mocha/clipboard_test.js +++ b/tests/mocha/clipboard_test.js @@ -5,14 +5,14 @@ */ import {assert} from '../../node_modules/chai/chai.js'; -import { - sharedTestSetup, - sharedTestTeardown, -} from './test_helpers/setup_teardown.js'; import { assertEventFired, createChangeListenerSpy, } from './test_helpers/events.js'; +import { + sharedTestSetup, + sharedTestTeardown, +} from './test_helpers/setup_teardown.js'; suite('Clipboard', function () { setup(function () { diff --git a/tests/mocha/comment_test.js b/tests/mocha/comment_test.js index d4091b9c2..3662a870f 100644 --- a/tests/mocha/comment_test.js +++ b/tests/mocha/comment_test.js @@ -4,9 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +import * as eventUtils from '../../build/src/core/events/utils.js'; import {assert} from '../../node_modules/chai/chai.js'; import {assertEventFired} from './test_helpers/events.js'; -import * as eventUtils from '../../build/src/core/events/utils.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/connection_checker_test.js b/tests/mocha/connection_checker_test.js index 20f85623a..f7aa33ba8 100644 --- a/tests/mocha/connection_checker_test.js +++ b/tests/mocha/connection_checker_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import {ConnectionType} from '../../build/src/core/connection_type.js'; +import {assert} from '../../node_modules/chai/chai.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/connection_db_test.js b/tests/mocha/connection_db_test.js index 11eeecf31..e7f397d54 100644 --- a/tests/mocha/connection_db_test.js +++ b/tests/mocha/connection_db_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import {ConnectionType} from '../../build/src/core/connection_type.js'; +import {assert} from '../../node_modules/chai/chai.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/connection_test.js b/tests/mocha/connection_test.js index 040f59f40..cefea1784 100644 --- a/tests/mocha/connection_test.js +++ b/tests/mocha/connection_test.js @@ -5,17 +5,17 @@ */ import {assert} from '../../node_modules/chai/chai.js'; +import { + defineRowBlock, + defineStackBlock, + defineStatementBlock, +} from './test_helpers/block_definitions.js'; import { createGenUidStubWithReturns, sharedTestSetup, sharedTestTeardown, workspaceTeardown, } from './test_helpers/setup_teardown.js'; -import { - defineRowBlock, - defineStatementBlock, - defineStackBlock, -} from './test_helpers/block_definitions.js'; suite('Connection', function () { setup(function () { diff --git a/tests/mocha/contextmenu_test.js b/tests/mocha/contextmenu_test.js index b730b250d..fe6d4be99 100644 --- a/tests/mocha/contextmenu_test.js +++ b/tests/mocha/contextmenu_test.js @@ -4,16 +4,15 @@ * SPDX-License-Identifier: Apache-2.0 */ +import {callbackFactory} from '../../build/src/core/contextmenu.js'; +import * as xmlUtils from '../../build/src/core/utils/xml.js'; +import * as Variables from '../../build/src/core/variables.js'; import {assert} from '../../node_modules/chai/chai.js'; import { sharedTestSetup, sharedTestTeardown, } from './test_helpers/setup_teardown.js'; -import {callbackFactory} from '../../build/src/core/contextmenu.js'; -import * as xmlUtils from '../../build/src/core/utils/xml.js'; -import * as Variables from '../../build/src/core/variables.js'; - suite('Context Menu', function () { setup(function () { sharedTestSetup.call(this); diff --git a/tests/mocha/cursor_test.js b/tests/mocha/cursor_test.js index fcb763304..bb5026d7a 100644 --- a/tests/mocha/cursor_test.js +++ b/tests/mocha/cursor_test.js @@ -4,12 +4,12 @@ * SPDX-License-Identifier: Apache-2.0 */ +import {ASTNode} from '../../build/src/core/keyboard_nav/ast_node.js'; import {assert} from '../../node_modules/chai/chai.js'; import { sharedTestSetup, sharedTestTeardown, } from './test_helpers/setup_teardown.js'; -import {ASTNode} from '../../build/src/core/keyboard_nav/ast_node.js'; suite('Cursor', function () { setup(function () { diff --git a/tests/mocha/event_block_change_test.js b/tests/mocha/event_block_change_test.js index a4de1eddb..7de0a23b6 100644 --- a/tests/mocha/event_block_change_test.js +++ b/tests/mocha/event_block_change_test.js @@ -5,11 +5,11 @@ */ import {assert} from '../../node_modules/chai/chai.js'; +import {defineMutatorBlocks} from './test_helpers/block_definitions.js'; import { sharedTestSetup, sharedTestTeardown, } from './test_helpers/setup_teardown.js'; -import {defineMutatorBlocks} from './test_helpers/block_definitions.js'; suite('Block Change Event', function () { setup(function () { diff --git a/tests/mocha/event_block_create_test.js b/tests/mocha/event_block_create_test.js index 4ca6fb22a..94d9c72b3 100644 --- a/tests/mocha/event_block_create_test.js +++ b/tests/mocha/event_block_create_test.js @@ -4,14 +4,14 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; -import {assertEventFired} from './test_helpers/events.js'; import * as eventUtils from '../../build/src/core/events/utils.js'; +import {assert} from '../../node_modules/chai/chai.js'; +import {defineRowBlock} from './test_helpers/block_definitions.js'; +import {assertEventFired} from './test_helpers/events.js'; import { sharedTestSetup, sharedTestTeardown, } from './test_helpers/setup_teardown.js'; -import {defineRowBlock} from './test_helpers/block_definitions.js'; suite('Block Create Event', function () { setup(function () { diff --git a/tests/mocha/event_test.js b/tests/mocha/event_test.js index 0a4e96d2b..75b52bede 100644 --- a/tests/mocha/event_test.js +++ b/tests/mocha/event_test.js @@ -4,22 +4,22 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; +import * as eventUtils from '../../build/src/core/events/utils.js'; import {ASTNode} from '../../build/src/core/keyboard_nav/ast_node.js'; +import {assert} from '../../node_modules/chai/chai.js'; import { assertEventEquals, assertNthCallEventArgEquals, createChangeListenerSpy, } from './test_helpers/events.js'; -import {assertVariableValues} from './test_helpers/variables.js'; import { createGenUidStubWithReturns, sharedTestSetup, sharedTestTeardown, workspaceTeardown, } from './test_helpers/setup_teardown.js'; -import * as eventUtils from '../../build/src/core/events/utils.js'; +import {assertVariableValues} from './test_helpers/variables.js'; suite('Events', function () { setup(function () { diff --git a/tests/mocha/field_checkbox_test.js b/tests/mocha/field_checkbox_test.js index 1db3c9a4b..08190fed8 100644 --- a/tests/mocha/field_checkbox_test.js +++ b/tests/mocha/field_checkbox_test.js @@ -4,8 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; +import {assert} from '../../node_modules/chai/chai.js'; +import {defineRowBlock} from './test_helpers/block_definitions.js'; import { assertFieldValue, runConstructorSuiteTests, @@ -17,7 +18,6 @@ import { sharedTestTeardown, workspaceTeardown, } from './test_helpers/setup_teardown.js'; -import {defineRowBlock} from './test_helpers/block_definitions.js'; suite('Checkbox Fields', function () { setup(function () { diff --git a/tests/mocha/field_colour_test.js b/tests/mocha/field_colour_test.js index ed30be552..262f978f2 100644 --- a/tests/mocha/field_colour_test.js +++ b/tests/mocha/field_colour_test.js @@ -4,18 +4,18 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; +import {assert} from '../../node_modules/chai/chai.js'; +import { + createTestBlock, + defineRowBlock, +} from './test_helpers/block_definitions.js'; import { assertFieldValue, runConstructorSuiteTests, runFromJsonSuiteTests, runSetValueTests, } from './test_helpers/fields.js'; -import { - createTestBlock, - defineRowBlock, -} from './test_helpers/block_definitions.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/field_dropdown_test.js b/tests/mocha/field_dropdown_test.js index c0261bc65..61deaf47f 100644 --- a/tests/mocha/field_dropdown_test.js +++ b/tests/mocha/field_dropdown_test.js @@ -4,18 +4,18 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; +import {assert} from '../../node_modules/chai/chai.js'; +import { + createTestBlock, + defineRowBlock, +} from './test_helpers/block_definitions.js'; import { assertFieldValue, runConstructorSuiteTests, runFromJsonSuiteTests, runSetValueTests, } from './test_helpers/fields.js'; -import { - createTestBlock, - defineRowBlock, -} from './test_helpers/block_definitions.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/field_image_test.js b/tests/mocha/field_image_test.js index ed1ec5596..89dd5fcc9 100644 --- a/tests/mocha/field_image_test.js +++ b/tests/mocha/field_image_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; +import {assert} from '../../node_modules/chai/chai.js'; import { assertFieldValue, runConstructorSuiteTests, diff --git a/tests/mocha/field_label_serializable_test.js b/tests/mocha/field_label_serializable_test.js index f6502db08..a83171341 100644 --- a/tests/mocha/field_label_serializable_test.js +++ b/tests/mocha/field_label_serializable_test.js @@ -4,8 +4,12 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; +import {assert} from '../../node_modules/chai/chai.js'; +import { + createTestBlock, + defineRowBlock, +} from './test_helpers/block_definitions.js'; import { assertFieldValue, runConstructorSuiteTests, @@ -17,10 +21,6 @@ import { sharedTestTeardown, workspaceTeardown, } from './test_helpers/setup_teardown.js'; -import { - createTestBlock, - defineRowBlock, -} from './test_helpers/block_definitions.js'; suite('Label Serializable Fields', function () { setup(function () { diff --git a/tests/mocha/field_label_test.js b/tests/mocha/field_label_test.js index 43883ebf8..cf5b49044 100644 --- a/tests/mocha/field_label_test.js +++ b/tests/mocha/field_label_test.js @@ -4,8 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; +import {assert} from '../../node_modules/chai/chai.js'; +import {createTestBlock} from './test_helpers/block_definitions.js'; import { assertFieldValue, runConstructorSuiteTests, @@ -16,7 +17,6 @@ import { sharedTestSetup, sharedTestTeardown, } from './test_helpers/setup_teardown.js'; -import {createTestBlock} from './test_helpers/block_definitions.js'; suite('Label Fields', function () { setup(function () { diff --git a/tests/mocha/field_number_test.js b/tests/mocha/field_number_test.js index fb6712046..3e0d8ca38 100644 --- a/tests/mocha/field_number_test.js +++ b/tests/mocha/field_number_test.js @@ -4,21 +4,21 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; +import {assert} from '../../node_modules/chai/chai.js'; +import {defineRowBlock} from './test_helpers/block_definitions.js'; +import {runTestCases} from './test_helpers/common.js'; import { assertFieldValue, runConstructorSuiteTests, runFromJsonSuiteTests, runSetValueTests, } from './test_helpers/fields.js'; -import {defineRowBlock} from './test_helpers/block_definitions.js'; import { sharedTestSetup, sharedTestTeardown, workspaceTeardown, } from './test_helpers/setup_teardown.js'; -import {runTestCases} from './test_helpers/common.js'; suite('Number Fields', function () { setup(function () { diff --git a/tests/mocha/field_registry_test.js b/tests/mocha/field_registry_test.js index c6ec26967..26b33c16c 100644 --- a/tests/mocha/field_registry_test.js +++ b/tests/mocha/field_registry_test.js @@ -4,9 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; -import {createDeprecationWarningStub} from './test_helpers/warnings.js'; +import {assert} from '../../node_modules/chai/chai.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/field_test.js b/tests/mocha/field_test.js index dfc798033..70970b9bf 100644 --- a/tests/mocha/field_test.js +++ b/tests/mocha/field_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; +import {assert} from '../../node_modules/chai/chai.js'; import { addBlockTypeToCleanup, addMessageToCleanup, @@ -13,7 +13,6 @@ import { sharedTestTeardown, workspaceTeardown, } from './test_helpers/setup_teardown.js'; -import {createDeprecationWarningStub} from './test_helpers/warnings.js'; suite('Abstract Fields', function () { setup(function () { diff --git a/tests/mocha/field_textinput_test.js b/tests/mocha/field_textinput_test.js index 7b0da1b4c..3b755a543 100644 --- a/tests/mocha/field_textinput_test.js +++ b/tests/mocha/field_textinput_test.js @@ -4,18 +4,18 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; +import {assert} from '../../node_modules/chai/chai.js'; +import { + createTestBlock, + defineRowBlock, +} from './test_helpers/block_definitions.js'; import { assertFieldValue, runConstructorSuiteTests, runFromJsonSuiteTests, runSetValueTests, } from './test_helpers/fields.js'; -import { - createTestBlock, - defineRowBlock, -} from './test_helpers/block_definitions.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/field_variable_test.js b/tests/mocha/field_variable_test.js index 63dd644c3..78dad10ba 100644 --- a/tests/mocha/field_variable_test.js +++ b/tests/mocha/field_variable_test.js @@ -4,8 +4,12 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; +import {assert} from '../../node_modules/chai/chai.js'; +import { + createTestBlock, + defineRowBlock, +} from './test_helpers/block_definitions.js'; import { assertFieldValue, runConstructorSuiteTests, @@ -18,10 +22,6 @@ import { sharedTestTeardown, workspaceTeardown, } from './test_helpers/setup_teardown.js'; -import { - createTestBlock, - defineRowBlock, -} from './test_helpers/block_definitions.js'; suite('Variable Fields', function () { const FAKE_VARIABLE_NAME = 'default_name'; diff --git a/tests/mocha/flyout_test.js b/tests/mocha/flyout_test.js index 522efbdc6..9be45458c 100644 --- a/tests/mocha/flyout_test.js +++ b/tests/mocha/flyout_test.js @@ -10,16 +10,8 @@ import { sharedTestTeardown, workspaceTeardown, } from './test_helpers/setup_teardown.js'; -import {defineStackBlock} from './test_helpers/block_definitions.js'; import { - getBasicToolbox, - getChildItem, - getCollapsibleItem, - getDeeplyNestedJSON, - getInjectedToolbox, - getNonCollapsibleItem, getProperSimpleJson, - getSeparator, getSimpleJson, getXmlArray, } from './test_helpers/toolbox_definitions.js'; diff --git a/tests/mocha/generator_test.js b/tests/mocha/generator_test.js index efaa924de..527448eac 100644 --- a/tests/mocha/generator_test.js +++ b/tests/mocha/generator_test.js @@ -4,13 +4,13 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; import {DartGenerator} from '../../build/src/generators/dart/dart_generator.js'; import {JavascriptGenerator} from '../../build/src/generators/javascript/javascript_generator.js'; import {LuaGenerator} from '../../build/src/generators/lua/lua_generator.js'; import {PhpGenerator} from '../../build/src/generators/php/php_generator.js'; import {PythonGenerator} from '../../build/src/generators/python/python_generator.js'; +import {assert} from '../../node_modules/chai/chai.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/gesture_test.js b/tests/mocha/gesture_test.js index 122e96b8b..be807a54a 100644 --- a/tests/mocha/gesture_test.js +++ b/tests/mocha/gesture_test.js @@ -4,15 +4,15 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; -import {assertEventFired, assertEventNotFired} from './test_helpers/events.js'; -import {defineBasicBlockWithField} from './test_helpers/block_definitions.js'; -import {dispatchPointerEvent} from './test_helpers/user_input.js'; import * as eventUtils from '../../build/src/core/events/utils.js'; +import {assert} from '../../node_modules/chai/chai.js'; +import {defineBasicBlockWithField} from './test_helpers/block_definitions.js'; +import {assertEventFired, assertEventNotFired} from './test_helpers/events.js'; import { sharedTestSetup, sharedTestTeardown, } from './test_helpers/setup_teardown.js'; +import {dispatchPointerEvent} from './test_helpers/user_input.js'; suite('Gesture', function () { function testGestureIsFieldClick(block, isFieldClick, eventsFireStub) { diff --git a/tests/mocha/icon_test.js b/tests/mocha/icon_test.js index dd5668b24..5855fcfc5 100644 --- a/tests/mocha/icon_test.js +++ b/tests/mocha/icon_test.js @@ -5,12 +5,12 @@ */ import {assert} from '../../node_modules/chai/chai.js'; +import {defineEmptyBlock} from './test_helpers/block_definitions.js'; +import {MockIcon, MockSerializableIcon} from './test_helpers/icon_mocks.js'; import { sharedTestSetup, sharedTestTeardown, } from './test_helpers/setup_teardown.js'; -import {defineEmptyBlock} from './test_helpers/block_definitions.js'; -import {MockIcon, MockSerializableIcon} from './test_helpers/icon_mocks.js'; suite('Icon', function () { setup(function () { diff --git a/tests/mocha/insertion_marker_manager_test.js b/tests/mocha/insertion_marker_manager_test.js index e6992109f..3fae888df 100644 --- a/tests/mocha/insertion_marker_manager_test.js +++ b/tests/mocha/insertion_marker_manager_test.js @@ -5,15 +5,15 @@ */ import {assert} from '../../node_modules/chai/chai.js'; -import { - sharedTestSetup, - sharedTestTeardown, -} from './test_helpers/setup_teardown.js'; import { defineRowBlock, defineRowToStackBlock, defineStackBlock, } from './test_helpers/block_definitions.js'; +import { + sharedTestSetup, + sharedTestTeardown, +} from './test_helpers/setup_teardown.js'; suite('Insertion marker manager', function () { setup(function () { diff --git a/tests/mocha/jso_deserialization_test.js b/tests/mocha/jso_deserialization_test.js index 7bd902a23..432f0a831 100644 --- a/tests/mocha/jso_deserialization_test.js +++ b/tests/mocha/jso_deserialization_test.js @@ -4,18 +4,17 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; -import { - sharedTestSetup, - sharedTestTeardown, - workspaceTeardown, -} from './test_helpers/setup_teardown.js'; -import {assertEventFired} from './test_helpers/events.js'; import * as eventUtils from '../../build/src/core/events/utils.js'; +import {assert} from '../../node_modules/chai/chai.js'; +import {assertEventFired} from './test_helpers/events.js'; import { MockParameterModel, MockProcedureModel, } from './test_helpers/procedures.js'; +import { + sharedTestSetup, + sharedTestTeardown, +} from './test_helpers/setup_teardown.js'; suite('JSO Deserialization', function () { setup(function () { diff --git a/tests/mocha/jso_serialization_test.js b/tests/mocha/jso_serialization_test.js index 8494dc3bc..7e68edb98 100644 --- a/tests/mocha/jso_serialization_test.js +++ b/tests/mocha/jso_serialization_test.js @@ -4,14 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; -import { - createGenUidStubWithReturns, - sharedTestSetup, - sharedTestTeardown, - workspaceTeardown, -} from './test_helpers/setup_teardown.js'; +import {assert} from '../../node_modules/chai/chai.js'; import { defineRowBlock, defineStackBlock, @@ -21,6 +15,12 @@ import { MockParameterModel, MockProcedureModel, } from './test_helpers/procedures.js'; +import { + createGenUidStubWithReturns, + sharedTestSetup, + sharedTestTeardown, + workspaceTeardown, +} from './test_helpers/setup_teardown.js'; suite('JSO Serialization', function () { setup(function () { diff --git a/tests/mocha/keydown_test.js b/tests/mocha/keydown_test.js index 077aff55e..da8129b48 100644 --- a/tests/mocha/keydown_test.js +++ b/tests/mocha/keydown_test.js @@ -5,12 +5,12 @@ */ import * as Blockly from '../../build/src/core/blockly.js'; -import {createKeyDownEvent} from './test_helpers/user_input.js'; import {defineStackBlock} from './test_helpers/block_definitions.js'; import { sharedTestSetup, sharedTestTeardown, } from './test_helpers/setup_teardown.js'; +import {createKeyDownEvent} from './test_helpers/user_input.js'; suite('Key Down', function () { setup(function () { diff --git a/tests/mocha/mutator_test.js b/tests/mocha/mutator_test.js index 7fa47fd82..fb6d8caf0 100644 --- a/tests/mocha/mutator_test.js +++ b/tests/mocha/mutator_test.js @@ -5,15 +5,15 @@ */ import {assert} from '../../node_modules/chai/chai.js'; -import { - sharedTestSetup, - sharedTestTeardown, -} from './test_helpers/setup_teardown.js'; import { createRenderedBlock, defineMutatorBlocks, } from './test_helpers/block_definitions.js'; import {assertEventFired, assertEventNotFired} from './test_helpers/events.js'; +import { + sharedTestSetup, + sharedTestTeardown, +} from './test_helpers/setup_teardown.js'; suite('Mutator', function () { setup(function () { diff --git a/tests/mocha/procedure_map_test.js b/tests/mocha/procedure_map_test.js index 69166fdb7..eebd5a9f3 100644 --- a/tests/mocha/procedure_map_test.js +++ b/tests/mocha/procedure_map_test.js @@ -5,16 +5,11 @@ */ import {assert} from '../../node_modules/chai/chai.js'; +import {MockProcedureModel} from './test_helpers/procedures.js'; import { sharedTestSetup, sharedTestTeardown, } from './test_helpers/setup_teardown.js'; -import { - assertEventFiredShallow, - assertEventNotFired, - createChangeListenerSpy, -} from './test_helpers/events.js'; -import {MockProcedureModel} from './test_helpers/procedures.js'; suite('Procedure Map', function () { setup(function () { diff --git a/tests/mocha/registry_test.js b/tests/mocha/registry_test.js index c1bbf442a..6bcb8b5b0 100644 --- a/tests/mocha/registry_test.js +++ b/tests/mocha/registry_test.js @@ -5,11 +5,11 @@ */ import {assert} from '../../node_modules/chai/chai.js'; -import {assertWarnings} from './test_helpers/warnings.js'; import { sharedTestSetup, sharedTestTeardown, } from './test_helpers/setup_teardown.js'; +import {assertWarnings} from './test_helpers/warnings.js'; suite('Registry', function () { const TestClass = function () {}; diff --git a/tests/mocha/serializer_test.js b/tests/mocha/serializer_test.js index 557608311..0cc073e7b 100644 --- a/tests/mocha/serializer_test.js +++ b/tests/mocha/serializer_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; +import {assert} from '../../node_modules/chai/chai.js'; import { TestCase, TestSuite, diff --git a/tests/mocha/shortcut_registry_test.js b/tests/mocha/shortcut_registry_test.js index 4c64f1e69..cfd98a302 100644 --- a/tests/mocha/shortcut_registry_test.js +++ b/tests/mocha/shortcut_registry_test.js @@ -5,11 +5,11 @@ */ import {assert} from '../../node_modules/chai/chai.js'; -import {createKeyDownEvent} from './test_helpers/user_input.js'; import { sharedTestSetup, sharedTestTeardown, } from './test_helpers/setup_teardown.js'; +import {createKeyDownEvent} from './test_helpers/user_input.js'; suite('Keyboard Shortcut Registry Test', function () { setup(function () { diff --git a/tests/mocha/test_helpers/procedures.js b/tests/mocha/test_helpers/procedures.js index 82075ff27..ecf8c13ad 100644 --- a/tests/mocha/test_helpers/procedures.js +++ b/tests/mocha/test_helpers/procedures.js @@ -4,9 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../../node_modules/chai/chai.js'; import {ConnectionType} from '../../../build/src/core/connection_type.js'; import {VariableModel} from '../../../build/src/core/variable_model.js'; +import {assert} from '../../../node_modules/chai/chai.js'; /** * Asserts that the procedure definition or call block has the expected var diff --git a/tests/mocha/test_helpers/workspace.js b/tests/mocha/test_helpers/workspace.js index e312e1188..40b2574fc 100644 --- a/tests/mocha/test_helpers/workspace.js +++ b/tests/mocha/test_helpers/workspace.js @@ -4,11 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ +import * as eventUtils from '../../../build/src/core/events/utils.js'; import {assert} from '../../../node_modules/chai/chai.js'; +import {workspaceTeardown} from './setup_teardown.js'; import {assertVariableValues} from './variables.js'; import {assertWarnings} from './warnings.js'; -import * as eventUtils from '../../../build/src/core/events/utils.js'; -import {workspaceTeardown} from './setup_teardown.js'; export function testAWorkspace() { setup(function () { diff --git a/tests/mocha/theme_test.js b/tests/mocha/theme_test.js index 57aec45a2..e94bc5e50 100644 --- a/tests/mocha/theme_test.js +++ b/tests/mocha/theme_test.js @@ -4,9 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +import * as eventUtils from '../../build/src/core/events/utils.js'; import {assert} from '../../node_modules/chai/chai.js'; import {assertEventFired} from './test_helpers/events.js'; -import * as eventUtils from '../../build/src/core/events/utils.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/trashcan_test.js b/tests/mocha/trashcan_test.js index 798f604ff..7ba624094 100644 --- a/tests/mocha/trashcan_test.js +++ b/tests/mocha/trashcan_test.js @@ -4,12 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ +import * as eventUtils from '../../build/src/core/events/utils.js'; import {assert} from '../../node_modules/chai/chai.js'; -import {assertEventFired, assertEventNotFired} from './test_helpers/events.js'; -import { - sharedTestSetup, - sharedTestTeardown, -} from './test_helpers/setup_teardown.js'; import { defineBasicBlockWithField, defineMutatorBlocks, @@ -17,7 +13,11 @@ import { defineStackBlock, defineStatementBlock, } from './test_helpers/block_definitions.js'; -import * as eventUtils from '../../build/src/core/events/utils.js'; +import {assertEventFired, assertEventNotFired} from './test_helpers/events.js'; +import { + sharedTestSetup, + sharedTestTeardown, +} from './test_helpers/setup_teardown.js'; import {simulateClick} from './test_helpers/user_input.js'; suite('Trashcan', function () { diff --git a/tests/mocha/variable_map_test.js b/tests/mocha/variable_map_test.js index c3d75e8a5..51f710c99 100644 --- a/tests/mocha/variable_map_test.js +++ b/tests/mocha/variable_map_test.js @@ -5,17 +5,17 @@ */ import {assert} from '../../node_modules/chai/chai.js'; -import {assertVariableValues} from './test_helpers/variables.js'; -import { - createGenUidStubWithReturns, - sharedTestSetup, - sharedTestTeardown, -} from './test_helpers/setup_teardown.js'; import { assertEventFired, assertEventNotFired, createChangeListenerSpy, } from './test_helpers/events.js'; +import { + createGenUidStubWithReturns, + sharedTestSetup, + sharedTestTeardown, +} from './test_helpers/setup_teardown.js'; +import {assertVariableValues} from './test_helpers/variables.js'; suite('Variable Map', function () { setup(function () { diff --git a/tests/mocha/workspace_comment_test.js b/tests/mocha/workspace_comment_test.js index ece1819e4..6e3fa9607 100644 --- a/tests/mocha/workspace_comment_test.js +++ b/tests/mocha/workspace_comment_test.js @@ -4,14 +4,14 @@ * SPDX-License-Identifier: Apache-2.0 */ +import { + assertEventFired, + createChangeListenerSpy, +} from './test_helpers/events.js'; import { sharedTestSetup, sharedTestTeardown, } from './test_helpers/setup_teardown.js'; -import { - createChangeListenerSpy, - assertEventFired, -} from './test_helpers/events.js'; suite('Workspace comment', function () { setup(function () { diff --git a/tests/mocha/workspace_svg_test.js b/tests/mocha/workspace_svg_test.js index 93f8f7158..7439ccc5d 100644 --- a/tests/mocha/workspace_svg_test.js +++ b/tests/mocha/workspace_svg_test.js @@ -4,19 +4,17 @@ * SPDX-License-Identifier: Apache-2.0 */ +import * as eventUtils from '../../build/src/core/events/utils.js'; import {assert} from '../../node_modules/chai/chai.js'; +import {defineStackBlock} from './test_helpers/block_definitions.js'; import { assertEventFired, assertEventNotFired, createChangeListenerSpy, } from './test_helpers/events.js'; -import {assertVariableValues} from './test_helpers/variables.js'; -import {defineStackBlock} from './test_helpers/block_definitions.js'; -import * as eventUtils from '../../build/src/core/events/utils.js'; import { sharedTestSetup, sharedTestTeardown, - workspaceTeardown, } from './test_helpers/setup_teardown.js'; import {testAWorkspace} from './test_helpers/workspace.js'; diff --git a/tests/mocha/workspace_test.js b/tests/mocha/workspace_test.js index 58829a77a..a517d796c 100644 --- a/tests/mocha/workspace_test.js +++ b/tests/mocha/workspace_test.js @@ -4,11 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assertVariableValues} from './test_helpers/variables.js'; import { sharedTestSetup, sharedTestTeardown, - workspaceTeardown, } from './test_helpers/setup_teardown.js'; import {testAWorkspace} from './test_helpers/workspace.js'; diff --git a/tests/mocha/zoom_controls_test.js b/tests/mocha/zoom_controls_test.js index dce8acfe6..8751420c8 100644 --- a/tests/mocha/zoom_controls_test.js +++ b/tests/mocha/zoom_controls_test.js @@ -4,9 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +import * as eventUtils from '../../build/src/core/events/utils.js'; import {assert} from '../../node_modules/chai/chai.js'; import {assertEventFired, assertEventNotFired} from './test_helpers/events.js'; -import * as eventUtils from '../../build/src/core/events/utils.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/node/run_node_test.mjs b/tests/node/run_node_test.mjs index f7a01098f..ee95fd528 100644 --- a/tests/node/run_node_test.mjs +++ b/tests/node/run_node_test.mjs @@ -22,9 +22,9 @@ console.log(process.cwd()); // copied when packaged), resulting in require() looking for the // compressed bundles in the wrong place. -import {assert} from 'chai'; import * as Blockly from 'blockly-test'; import {javascriptGenerator} from 'blockly-test/javascript'; +import {assert} from 'chai'; const xmlText = '\n' + diff --git a/tests/typescript/src/generators.ts b/tests/typescript/src/generators.ts index 61506e11a..d1358335d 100644 --- a/tests/typescript/src/generators.ts +++ b/tests/typescript/src/generators.ts @@ -7,11 +7,11 @@ /* eslint-disable */ import * as Blockly from 'blockly-test/core'; -import {JavascriptGenerator} from 'blockly-test/javascript'; -import {PhpGenerator, phpGenerator, Order} from 'blockly-test/php'; -import {LuaGenerator} from 'blockly-test/lua'; -import {PythonGenerator} from 'blockly-test/python'; import {DartGenerator} from 'blockly-test/dart'; +import {JavascriptGenerator} from 'blockly-test/javascript'; +import {LuaGenerator} from 'blockly-test/lua'; +import {Order, PhpGenerator, phpGenerator} from 'blockly-test/php'; +import {PythonGenerator} from 'blockly-test/python'; JavascriptGenerator; PhpGenerator; diff --git a/tests/typescript/src/generators/php.ts b/tests/typescript/src/generators/php.ts index cb9241b43..5b66d3d71 100644 --- a/tests/typescript/src/generators/php.ts +++ b/tests/typescript/src/generators/php.ts @@ -10,7 +10,7 @@ import * as Blockly from 'blockly-test/core'; * Test: should be able to import a generator instance, class, and * Order enum. */ -import {phpGenerator, PhpGenerator, Order} from 'blockly-test/php'; +import {Order, phpGenerator, PhpGenerator} from 'blockly-test/php'; /** * Test: should be able to create a simple block generator function, diff --git a/tests/typescript/src/generators/python.ts b/tests/typescript/src/generators/python.ts index aa1c19c38..572e992e4 100644 --- a/tests/typescript/src/generators/python.ts +++ b/tests/typescript/src/generators/python.ts @@ -10,7 +10,7 @@ import * as Blockly from 'blockly-test/core'; * Test: should be able to import a generator instance, class, and * Order enum. */ -import {pythonGenerator, PythonGenerator, Order} from 'blockly-test/python'; +import {Order, pythonGenerator, PythonGenerator} from 'blockly-test/python'; /** * Test: should be able to create a simple block generator function, From 17e4f1c96665dd56ff33f5a45db809f7e2805e82 Mon Sep 17 00:00:00 2001 From: John Nesky Date: Thu, 15 Aug 2024 11:41:22 -0700 Subject: [PATCH 27/90] Fix: let workspace comment have delete cursor over trash. (#8477) --- core/comments/comment_view.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/core/comments/comment_view.ts b/core/comments/comment_view.ts index bf615163c..72f72fa38 100644 --- a/core/comments/comment_view.ts +++ b/core/comments/comment_view.ts @@ -827,7 +827,6 @@ css.register(` } .blocklyCommentTopbarBackground { - cursor: grab; fill: var(--commentBorderColour); height: 24px; } From 806f8f95d27a2bb0c2358e6c3f262ee274748dc1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 08:59:07 -0700 Subject: [PATCH 28/90] chore(deps): bump typescript from 5.5.3 to 5.5.4 (#8535) Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.5.3 to 5.5.4. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml) - [Commits](https://github.com/Microsoft/TypeScript/compare/v5.5.3...v5.5.4) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 788993d05..fa88a3f6f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8853,9 +8853,9 @@ "dev": true }, "node_modules/typescript": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.3.tgz", - "integrity": "sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==", + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", + "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", "dev": true, "bin": { "tsc": "bin/tsc", From 7ccdcc5cef9de3745597ec3e1deef6495d5e148e Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Tue, 20 Aug 2024 08:36:33 +0100 Subject: [PATCH 29/90] refactor(events): introduce `EventType` enum in separate module (#8530) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor(events): Use "export ... from" where applicable * refactor(events): Introduce EventType enum Introduce an enum for the event .type values. We can't actually use it as the type of the .type property on Abstract events, because we want to allow developers to add their own custom event types inheriting from this type, but at least this way we can be reasonably sure that all of our own event subclasses have distinct .type values—plus consistent use of enum syntax (EventType.TYPE_NAME) is probably good for readability overall. Put it in a separate module from the rest of events/utils.ts because it would be helpful if event utils could use event instanceof SomeEventType for type narrowing but but at the moment most events are in modules that depend on events/utils.ts for their .type constant, and although circular ESM dependencies should work in principle there are various restrictions and this particular circularity causes issues at the moment. A few of the event classes also depend on utils.ts for fire() or other functions, which will be harder to deal with, but at least this commit is win in terms of reducing the complexity of our dependencies, making most of the Abstract event subclass module dependent on type.ts, which has no imports, rather than on utils.ts which has multiple imports. --- core/block.ts | 21 +- core/block_svg.ts | 7 +- core/bump_objects.ts | 15 +- core/clipboard/block_paster.ts | 3 +- core/clipboard/workspace_comment_paster.ts | 3 +- core/comments/workspace_comment.ts | 13 +- core/common.ts | 3 +- core/connection.ts | 5 +- core/contextmenu.ts | 3 +- core/dragging/block_drag_strategy.ts | 7 +- core/dragging/comment_drag_strategy.ts | 7 +- core/events/events.ts | 223 +++++++----------- core/events/events_abstract.ts | 6 +- core/events/events_block_change.ts | 5 +- core/events/events_block_create.ts | 5 +- core/events/events_block_delete.ts | 5 +- core/events/events_block_drag.ts | 6 +- .../events_block_field_intermediate_change.ts | 6 +- core/events/events_block_move.ts | 6 +- core/events/events_bubble_open.ts | 7 +- core/events/events_click.ts | 7 +- core/events/events_comment_base.ts | 6 +- core/events/events_comment_change.ts | 10 +- core/events/events_comment_collapse.ts | 6 +- core/events/events_comment_create.ts | 10 +- core/events/events_comment_delete.ts | 10 +- core/events/events_comment_drag.ts | 6 +- core/events/events_comment_move.ts | 6 +- core/events/events_comment_resize.ts | 10 +- core/events/events_marker_move.ts | 6 +- core/events/events_selected.ts | 6 +- core/events/events_theme_change.ts | 6 +- core/events/events_toolbox_item_select.ts | 6 +- core/events/events_trashcan_open.ts | 6 +- core/events/events_var_create.ts | 6 +- core/events/events_var_delete.ts | 6 +- core/events/events_var_rename.ts | 6 +- core/events/events_viewport.ts | 6 +- core/events/type.ts | 85 +++++++ core/events/utils.ts | 184 ++------------- core/events/workspace_events.ts | 6 +- core/field.ts | 3 +- core/field_input.ts | 7 +- core/flyout_base.ts | 5 +- core/gesture.ts | 5 +- core/icons/comment_icon.ts | 7 +- core/icons/mutator_icon.ts | 9 +- core/icons/warning_icon.ts | 3 +- core/procedures.ts | 13 +- core/renderers/common/marker_svg.ts | 3 +- core/serialization/blocks.ts | 7 +- core/serialization/workspaces.ts | 3 +- core/toolbox/toolbox.ts | 3 +- core/trashcan.ts | 7 +- core/variable_map.ts | 11 +- core/workspace_svg.ts | 5 +- core/xml.ts | 9 +- core/zoom_controls.ts | 3 +- tests/mocha/block_test.js | 5 +- tests/mocha/comment_test.js | 10 +- tests/mocha/event_block_create_test.js | 4 +- tests/mocha/gesture_test.js | 6 +- tests/mocha/jso_deserialization_test.js | 26 +- tests/mocha/theme_test.js | 4 +- tests/mocha/trashcan_test.js | 13 +- tests/mocha/workspace_svg_test.js | 8 +- tests/mocha/zoom_controls_test.js | 14 +- 67 files changed, 419 insertions(+), 530 deletions(-) create mode 100644 core/events/type.ts diff --git a/core/block.ts b/core/block.ts index 7875ac6a4..189f67781 100644 --- a/core/block.ts +++ b/core/block.ts @@ -26,6 +26,7 @@ import * as constants from './constants.js'; import type {Abstract} from './events/events_abstract.js'; import type {BlockChange} from './events/events_block_change.js'; import type {BlockMove} from './events/events_block_move.js'; +import {EventType} from './events/type.js'; import * as eventUtils from './events/utils.js'; import * as Extensions from './extensions.js'; import type {Field} from './field.js'; @@ -304,7 +305,7 @@ export class Block implements IASTNodeLocation { // Fire a create event. if (eventUtils.isEnabled()) { - eventUtils.fire(new (eventUtils.get(eventUtils.BLOCK_CREATE))(this)); + eventUtils.fire(new (eventUtils.get(EventType.BLOCK_CREATE))(this)); } } finally { eventUtils.setGroup(existingGroup); @@ -339,7 +340,7 @@ export class Block implements IASTNodeLocation { this.unplug(healStack); if (eventUtils.isEnabled()) { // Constructing the delete event is costly. Only perform if necessary. - eventUtils.fire(new (eventUtils.get(eventUtils.BLOCK_DELETE))(this)); + eventUtils.fire(new (eventUtils.get(EventType.BLOCK_DELETE))(this)); } this.workspace.removeTopBlock(this); this.disposeInternal(); @@ -1329,7 +1330,7 @@ export class Block implements IASTNodeLocation { setInputsInline(newBoolean: boolean) { if (this.inputsInline !== newBoolean) { eventUtils.fire( - new (eventUtils.get(eventUtils.BLOCK_CHANGE))( + new (eventUtils.get(EventType.BLOCK_CHANGE))( this, 'inline', null, @@ -1491,7 +1492,7 @@ export class Block implements IASTNodeLocation { } else { this.disabledReasons.delete(reason); } - const blockChangeEvent = new (eventUtils.get(eventUtils.BLOCK_CHANGE))( + const blockChangeEvent = new (eventUtils.get(EventType.BLOCK_CHANGE))( this, 'disabled', /* name= */ null, @@ -1559,7 +1560,7 @@ export class Block implements IASTNodeLocation { setCollapsed(collapsed: boolean) { if (this.collapsed_ !== collapsed) { eventUtils.fire( - new (eventUtils.get(eventUtils.BLOCK_CHANGE))( + new (eventUtils.get(EventType.BLOCK_CHANGE))( this, 'collapsed', null, @@ -2358,7 +2359,7 @@ export class Block implements IASTNodeLocation { } eventUtils.fire( - new (eventUtils.get(eventUtils.BLOCK_CHANGE))( + new (eventUtils.get(EventType.BLOCK_CHANGE))( this, 'comment', null, @@ -2458,12 +2459,8 @@ export class Block implements IASTNodeLocation { if (this.parentBlock_) { throw Error('Block has parent'); } - const event = new (eventUtils.get(eventUtils.BLOCK_MOVE))( - this, - ) as BlockMove; - if (reason) { - event.setReason(reason); - } + const event = new (eventUtils.get(EventType.BLOCK_MOVE))(this) as BlockMove; + if (reason) event.setReason(reason); this.xy_.translate(dx, dy); event.recordNew(); eventUtils.fire(event); diff --git a/core/block_svg.ts b/core/block_svg.ts index e3a60315e..db75acde2 100644 --- a/core/block_svg.ts +++ b/core/block_svg.ts @@ -32,6 +32,7 @@ import { } from './contextmenu_registry.js'; import {BlockDragStrategy} from './dragging/block_drag_strategy.js'; import type {BlockMove} from './events/events_block_move.js'; +import {EventType} from './events/type.js'; import * as eventUtils from './events/utils.js'; import type {Field} from './field.js'; import {FieldLabel} from './field_label.js'; @@ -377,10 +378,8 @@ export class BlockSvg const eventsEnabled = eventUtils.isEnabled(); let event: BlockMove | null = null; if (eventsEnabled) { - event = new (eventUtils.get(eventUtils.BLOCK_MOVE)!)(this) as BlockMove; - if (reason) { - event.setReason(reason); - } + event = new (eventUtils.get(EventType.BLOCK_MOVE)!)(this) as BlockMove; + if (reason) event.setReason(reason); } const delta = new Coordinate(dx, dy); diff --git a/core/bump_objects.ts b/core/bump_objects.ts index f9495b3d8..7fe1e3851 100644 --- a/core/bump_objects.ts +++ b/core/bump_objects.ts @@ -14,6 +14,7 @@ import type {CommentCreate} from './events/events_comment_create.js'; import type {CommentMove} from './events/events_comment_move.js'; import type {CommentResize} from './events/events_comment_resize.js'; import type {ViewportChange} from './events/events_viewport.js'; +import {BUMP_EVENTS, EventType} from './events/type.js'; import * as eventUtils from './events/utils.js'; import type {IBoundedElement} from './interfaces/i_bounded_element.js'; import type {ContainerRegion} from './metrics_manager.js'; @@ -99,7 +100,7 @@ export function bumpIntoBoundsHandler( return; } - if (eventUtils.BUMP_EVENTS.includes(e.type ?? '')) { + if (BUMP_EVENTS.includes(e.type ?? '')) { const scrollMetricsInWsCoords = metricsManager.getScrollMetrics(true); // Triggered by move/create event @@ -127,7 +128,7 @@ export function bumpIntoBoundsHandler( ); } eventUtils.setGroup(existingGroup); - } else if (e.type === eventUtils.VIEWPORT_CHANGE) { + } else if (e.type === EventType.VIEWPORT_CHANGE) { const viewportEvent = e as ViewportChange; if ( viewportEvent.scale && @@ -155,16 +156,16 @@ function extractObjectFromEvent( ): IBoundedElement | null { let object = null; switch (e.type) { - case eventUtils.BLOCK_CREATE: - case eventUtils.BLOCK_MOVE: + case EventType.BLOCK_CREATE: + case EventType.BLOCK_MOVE: object = workspace.getBlockById((e as BlockCreate | BlockMove).blockId!); if (object) { object = object.getRootBlock(); } break; - case eventUtils.COMMENT_CREATE: - case eventUtils.COMMENT_MOVE: - case eventUtils.COMMENT_RESIZE: + case EventType.COMMENT_CREATE: + case EventType.COMMENT_MOVE: + case EventType.COMMENT_RESIZE: object = workspace.getCommentById( (e as CommentCreate | CommentMove | CommentResize).commentId!, ) as RenderedWorkspaceComment; diff --git a/core/clipboard/block_paster.ts b/core/clipboard/block_paster.ts index 04c55c5b0..08ff220ee 100644 --- a/core/clipboard/block_paster.ts +++ b/core/clipboard/block_paster.ts @@ -7,6 +7,7 @@ import {BlockSvg} from '../block_svg.js'; import * as common from '../common.js'; import {config} from '../config.js'; +import {EventType} from '../events/type.js'; import * as eventUtils from '../events/utils.js'; import {ICopyData} from '../interfaces/i_copyable.js'; import {IPaster} from '../interfaces/i_paster.js'; @@ -52,7 +53,7 @@ export class BlockPaster implements IPaster { if (!block) return block; if (eventUtils.isEnabled() && !block.isShadow()) { - eventUtils.fire(new (eventUtils.get(eventUtils.BLOCK_CREATE))(block)); + eventUtils.fire(new (eventUtils.get(EventType.BLOCK_CREATE))(block)); } common.setSelected(block); return block; diff --git a/core/clipboard/workspace_comment_paster.ts b/core/clipboard/workspace_comment_paster.ts index 173949a2b..fdfbf0a84 100644 --- a/core/clipboard/workspace_comment_paster.ts +++ b/core/clipboard/workspace_comment_paster.ts @@ -6,6 +6,7 @@ import {RenderedWorkspaceComment} from '../comments/rendered_workspace_comment.js'; import * as common from '../common.js'; +import {EventType} from '../events/type.js'; import * as eventUtils from '../events/utils.js'; import {ICopyData} from '../interfaces/i_copyable.js'; import {IPaster} from '../interfaces/i_paster.js'; @@ -46,7 +47,7 @@ export class WorkspaceCommentPaster if (!comment) return null; if (eventUtils.isEnabled()) { - eventUtils.fire(new (eventUtils.get(eventUtils.COMMENT_CREATE))(comment)); + eventUtils.fire(new (eventUtils.get(EventType.COMMENT_CREATE))(comment)); } common.setSelected(comment); return comment; diff --git a/core/comments/workspace_comment.ts b/core/comments/workspace_comment.ts index a659bc8d9..bda77f28c 100644 --- a/core/comments/workspace_comment.ts +++ b/core/comments/workspace_comment.ts @@ -6,6 +6,7 @@ import {CommentMove} from '../events/events_comment_move.js'; import {CommentResize} from '../events/events_comment_resize.js'; +import {EventType} from '../events/type.js'; import * as eventUtils from '../events/utils.js'; import {Coordinate} from '../utils/coordinate.js'; import * as idGenerator from '../utils/idgenerator.js'; @@ -63,13 +64,13 @@ export class WorkspaceComment { private fireCreateEvent() { if (eventUtils.isEnabled()) { - eventUtils.fire(new (eventUtils.get(eventUtils.COMMENT_CREATE))(this)); + eventUtils.fire(new (eventUtils.get(EventType.COMMENT_CREATE))(this)); } } private fireDeleteEvent() { if (eventUtils.isEnabled()) { - eventUtils.fire(new (eventUtils.get(eventUtils.COMMENT_DELETE))(this)); + eventUtils.fire(new (eventUtils.get(EventType.COMMENT_DELETE))(this)); } } @@ -77,7 +78,7 @@ export class WorkspaceComment { private fireChangeEvent(oldText: string, newText: string) { if (eventUtils.isEnabled()) { eventUtils.fire( - new (eventUtils.get(eventUtils.COMMENT_CHANGE))(this, oldText, newText), + new (eventUtils.get(EventType.COMMENT_CHANGE))(this, oldText, newText), ); } } @@ -86,7 +87,7 @@ export class WorkspaceComment { private fireCollapseEvent(newCollapsed: boolean) { if (eventUtils.isEnabled()) { eventUtils.fire( - new (eventUtils.get(eventUtils.COMMENT_COLLAPSE))(this, newCollapsed), + new (eventUtils.get(EventType.COMMENT_COLLAPSE))(this, newCollapsed), ); } } @@ -105,7 +106,7 @@ export class WorkspaceComment { /** Sets the comment's size in workspace units. */ setSize(size: Size) { - const event = new (eventUtils.get(eventUtils.COMMENT_RESIZE))( + const event = new (eventUtils.get(EventType.COMMENT_RESIZE))( this, ) as CommentResize; @@ -196,7 +197,7 @@ export class WorkspaceComment { /** Moves the comment to the given location in workspace coordinates. */ moveTo(location: Coordinate, reason?: string[] | undefined) { - const event = new (eventUtils.get(eventUtils.COMMENT_MOVE))( + const event = new (eventUtils.get(EventType.COMMENT_MOVE))( this, ) as CommentMove; if (reason) event.setReason(reason); diff --git a/core/common.ts b/core/common.ts index fcd27b00d..bc31bf17e 100644 --- a/core/common.ts +++ b/core/common.ts @@ -10,6 +10,7 @@ import type {Block} from './block.js'; import {ISelectable} from './blockly.js'; import {BlockDefinition, Blocks} from './blocks.js'; import type {Connection} from './connection.js'; +import {EventType} from './events/type.js'; import * as eventUtils from './events/utils.js'; import type {Workspace} from './workspace.js'; import type {WorkspaceSvg} from './workspace_svg.js'; @@ -107,7 +108,7 @@ export function getSelected(): ISelectable | null { export function setSelected(newSelection: ISelectable | null) { if (selected === newSelection) return; - const event = new (eventUtils.get(eventUtils.SELECTED))( + const event = new (eventUtils.get(EventType.SELECTED))( selected?.id ?? null, newSelection?.id ?? null, newSelection?.workspace.id ?? selected?.workspace.id ?? '', diff --git a/core/connection.ts b/core/connection.ts index 1dd8dc1ea..93caf5bcf 100644 --- a/core/connection.ts +++ b/core/connection.ts @@ -14,6 +14,7 @@ import type {Block} from './block.js'; import {ConnectionType} from './connection_type.js'; import type {BlockMove} from './events/events_block_move.js'; +import {EventType} from './events/type.js'; import * as eventUtils from './events/utils.js'; import type {Input} from './inputs/input.js'; import type {IASTNodeLocationWithBlock} from './interfaces/i_ast_node_location_with_block.js'; @@ -114,7 +115,7 @@ export class Connection implements IASTNodeLocationWithBlock { // Connect the new connection to the parent. let event; if (eventUtils.isEnabled()) { - event = new (eventUtils.get(eventUtils.BLOCK_MOVE))( + event = new (eventUtils.get(EventType.BLOCK_MOVE))( childBlock, ) as BlockMove; event.setReason(['connect']); @@ -281,7 +282,7 @@ export class Connection implements IASTNodeLocationWithBlock { let event; if (eventUtils.isEnabled()) { - event = new (eventUtils.get(eventUtils.BLOCK_MOVE))( + event = new (eventUtils.get(EventType.BLOCK_MOVE))( childConnection.getSourceBlock(), ) as BlockMove; event.setReason(['disconnect']); diff --git a/core/contextmenu.ts b/core/contextmenu.ts index 8f4626358..b49dcba51 100644 --- a/core/contextmenu.ts +++ b/core/contextmenu.ts @@ -15,6 +15,7 @@ import type { ContextMenuOption, LegacyContextMenuOption, } from './contextmenu_registry.js'; +import {EventType} from './events/type.js'; import * as eventUtils from './events/utils.js'; import {Menu} from './menu.js'; import {MenuItem} from './menuitem.js'; @@ -260,7 +261,7 @@ export function callbackFactory( eventUtils.enable(); } if (eventUtils.isEnabled() && !newBlock.isShadow()) { - eventUtils.fire(new (eventUtils.get(eventUtils.BLOCK_CREATE))(newBlock)); + eventUtils.fire(new (eventUtils.get(EventType.BLOCK_CREATE))(newBlock)); } common.setSelected(newBlock); return newBlock; diff --git a/core/dragging/block_drag_strategy.ts b/core/dragging/block_drag_strategy.ts index 968de3902..c3be97da6 100644 --- a/core/dragging/block_drag_strategy.ts +++ b/core/dragging/block_drag_strategy.ts @@ -12,6 +12,7 @@ import {config} from '../config.js'; import {Connection} from '../connection.js'; import {ConnectionType} from '../connection_type.js'; import type {BlockMove} from '../events/events_block_move.js'; +import {EventType} from '../events/type.js'; import * as eventUtils from '../events/utils.js'; import {IConnectionPreviewer} from '../interfaces/i_connection_previewer.js'; import {IDragStrategy} from '../interfaces/i_draggable.js'; @@ -177,7 +178,7 @@ export class BlockDragStrategy implements IDragStrategy { /** Fire a UI event at the start of a block drag. */ private fireDragStartEvent() { - const event = new (eventUtils.get(eventUtils.BLOCK_DRAG))( + const event = new (eventUtils.get(EventType.BLOCK_DRAG))( this.block, true, this.block.getDescendants(false), @@ -187,7 +188,7 @@ export class BlockDragStrategy implements IDragStrategy { /** Fire a UI event at the end of a block drag. */ private fireDragEndEvent() { - const event = new (eventUtils.get(eventUtils.BLOCK_DRAG))( + const event = new (eventUtils.get(EventType.BLOCK_DRAG))( this.block, false, this.block.getDescendants(false), @@ -198,7 +199,7 @@ export class BlockDragStrategy implements IDragStrategy { /** Fire a move event at the end of a block drag. */ private fireMoveEvent() { if (this.block.isDeadOrDying()) return; - const event = new (eventUtils.get(eventUtils.BLOCK_MOVE))( + const event = new (eventUtils.get(EventType.BLOCK_MOVE))( this.block, ) as BlockMove; event.setReason(['drag']); diff --git a/core/dragging/comment_drag_strategy.ts b/core/dragging/comment_drag_strategy.ts index 4053638c2..bc48c0e6c 100644 --- a/core/dragging/comment_drag_strategy.ts +++ b/core/dragging/comment_drag_strategy.ts @@ -6,6 +6,7 @@ import {RenderedWorkspaceComment} from '../comments.js'; import {CommentMove} from '../events/events_comment_move.js'; +import {EventType} from '../events/type.js'; import * as eventUtils from '../events/utils.js'; import {IDragStrategy} from '../interfaces/i_draggable.js'; import * as layers from '../layers.js'; @@ -63,7 +64,7 @@ export class CommentDragStrategy implements IDragStrategy { /** Fire a UI event at the start of a comment drag. */ private fireDragStartEvent() { - const event = new (eventUtils.get(eventUtils.COMMENT_DRAG))( + const event = new (eventUtils.get(EventType.COMMENT_DRAG))( this.comment, true, ); @@ -72,7 +73,7 @@ export class CommentDragStrategy implements IDragStrategy { /** Fire a UI event at the end of a comment drag. */ private fireDragEndEvent() { - const event = new (eventUtils.get(eventUtils.COMMENT_DRAG))( + const event = new (eventUtils.get(EventType.COMMENT_DRAG))( this.comment, false, ); @@ -82,7 +83,7 @@ export class CommentDragStrategy implements IDragStrategy { /** Fire a move event at the end of a comment drag. */ private fireMoveEvent() { if (this.comment.isDeadOrDying()) return; - const event = new (eventUtils.get(eventUtils.COMMENT_MOVE))( + const event = new (eventUtils.get(EventType.COMMENT_MOVE))( this.comment, ) as CommentMove; event.setReason(['drag']); diff --git a/core/events/events.ts b/core/events/events.ts index 97dc8cba4..868995653 100644 --- a/core/events/events.ts +++ b/core/events/events.ts @@ -6,156 +6,103 @@ // Former goog.module ID: Blockly.Events -import {Abstract, AbstractEventJson} from './events_abstract.js'; -import {BlockBase, BlockBaseJson} from './events_block_base.js'; -import {BlockChange, BlockChangeJson} from './events_block_change.js'; -import {BlockCreate, BlockCreateJson} from './events_block_create.js'; -import {BlockDelete, BlockDeleteJson} from './events_block_delete.js'; -import {BlockDrag, BlockDragJson} from './events_block_drag.js'; -import { +import {EventType} from './type.js'; + +// Events. +export {Abstract, AbstractEventJson} from './events_abstract.js'; +export {BlockBase, BlockBaseJson} from './events_block_base.js'; +export {BlockChange, BlockChangeJson} from './events_block_change.js'; +export {BlockCreate, BlockCreateJson} from './events_block_create.js'; +export {BlockDelete, BlockDeleteJson} from './events_block_delete.js'; +export {BlockDrag, BlockDragJson} from './events_block_drag.js'; +export { BlockFieldIntermediateChange, BlockFieldIntermediateChangeJson, } from './events_block_field_intermediate_change.js'; -import {BlockMove, BlockMoveJson} from './events_block_move.js'; -import {BubbleOpen, BubbleOpenJson, BubbleType} from './events_bubble_open.js'; -import {Click, ClickJson, ClickTarget} from './events_click.js'; -import {CommentBase, CommentBaseJson} from './events_comment_base.js'; -import {CommentChange, CommentChangeJson} from './events_comment_change.js'; -import { +export {BlockMove, BlockMoveJson} from './events_block_move.js'; +export {BubbleOpen, BubbleOpenJson, BubbleType} from './events_bubble_open.js'; +export {Click, ClickJson, ClickTarget} from './events_click.js'; +export {CommentBase, CommentBaseJson} from './events_comment_base.js'; +export {CommentChange, CommentChangeJson} from './events_comment_change.js'; +export { CommentCollapse, CommentCollapseJson, } from './events_comment_collapse.js'; -import {CommentCreate, CommentCreateJson} from './events_comment_create.js'; -import {CommentDelete} from './events_comment_delete.js'; -import {CommentDrag, CommentDragJson} from './events_comment_drag.js'; -import {CommentMove, CommentMoveJson} from './events_comment_move.js'; -import {CommentResize, CommentResizeJson} from './events_comment_resize.js'; -import {MarkerMove, MarkerMoveJson} from './events_marker_move.js'; -import {Selected, SelectedJson} from './events_selected.js'; -import {ThemeChange, ThemeChangeJson} from './events_theme_change.js'; -import { +export {CommentCreate, CommentCreateJson} from './events_comment_create.js'; +export {CommentDelete} from './events_comment_delete.js'; +export {CommentDrag, CommentDragJson} from './events_comment_drag.js'; +export {CommentMove, CommentMoveJson} from './events_comment_move.js'; +export {CommentResize, CommentResizeJson} from './events_comment_resize.js'; +export {MarkerMove, MarkerMoveJson} from './events_marker_move.js'; +export {Selected, SelectedJson} from './events_selected.js'; +export {ThemeChange, ThemeChangeJson} from './events_theme_change.js'; +export { ToolboxItemSelect, ToolboxItemSelectJson, } from './events_toolbox_item_select.js'; -import {TrashcanOpen, TrashcanOpenJson} from './events_trashcan_open.js'; -import {UiBase} from './events_ui_base.js'; -import {VarBase, VarBaseJson} from './events_var_base.js'; -import {VarCreate, VarCreateJson} from './events_var_create.js'; -import {VarDelete, VarDeleteJson} from './events_var_delete.js'; -import {VarRename, VarRenameJson} from './events_var_rename.js'; -import {ViewportChange, ViewportChangeJson} from './events_viewport.js'; -import * as eventUtils from './utils.js'; -import {FinishedLoading} from './workspace_events.js'; +export {TrashcanOpen, TrashcanOpenJson} from './events_trashcan_open.js'; +export {UiBase} from './events_ui_base.js'; +export {VarBase, VarBaseJson} from './events_var_base.js'; +export {VarCreate, VarCreateJson} from './events_var_create.js'; +export {VarDelete, VarDeleteJson} from './events_var_delete.js'; +export {VarRename, VarRenameJson} from './events_var_rename.js'; +export {ViewportChange, ViewportChangeJson} from './events_viewport.js'; +export {FinishedLoading} from './workspace_events.js'; -// Events. -export { - Abstract, - AbstractEventJson, - BlockBase, - BlockBaseJson, - BlockChange, - BlockChangeJson, - BlockCreate, - BlockCreateJson, - BlockDelete, - BlockDeleteJson, - BlockDrag, - BlockDragJson, - BlockFieldIntermediateChange, - BlockFieldIntermediateChangeJson, - BlockMove, - BlockMoveJson, - BubbleOpen, - BubbleOpenJson, - BubbleType, - Click, - ClickJson, - ClickTarget, - CommentBase, - CommentBaseJson, - CommentChange, - CommentChangeJson, - CommentCollapse, - CommentCollapseJson, - CommentCreate, - CommentCreateJson, - CommentDelete, - CommentDrag, - CommentDragJson, - CommentMove, - CommentMoveJson, - CommentResize, - CommentResizeJson, - FinishedLoading, - MarkerMove, - MarkerMoveJson, - Selected, - SelectedJson, - ThemeChange, - ThemeChangeJson, - ToolboxItemSelect, - ToolboxItemSelectJson, - TrashcanOpen, - TrashcanOpenJson, - UiBase, - VarBase, - VarBaseJson, - VarCreate, - VarCreateJson, - VarDelete, - VarDeleteJson, - VarRename, - VarRenameJson, - ViewportChange, - ViewportChangeJson, -}; +export type {BumpEvent} from './utils.js'; // Event types. -export const BLOCK_CHANGE = eventUtils.BLOCK_CHANGE; -export const BLOCK_CREATE = eventUtils.BLOCK_CREATE; -export const BLOCK_DELETE = eventUtils.BLOCK_DELETE; -export const BLOCK_DRAG = eventUtils.BLOCK_DRAG; -export const BLOCK_MOVE = eventUtils.BLOCK_MOVE; +export const BLOCK_CHANGE = EventType.BLOCK_CHANGE; +export const BLOCK_CREATE = EventType.BLOCK_CREATE; +export const BLOCK_DELETE = EventType.BLOCK_DELETE; +export const BLOCK_DRAG = EventType.BLOCK_DRAG; +export const BLOCK_MOVE = EventType.BLOCK_MOVE; export const BLOCK_FIELD_INTERMEDIATE_CHANGE = - eventUtils.BLOCK_FIELD_INTERMEDIATE_CHANGE; -export const BUBBLE_OPEN = eventUtils.BUBBLE_OPEN; -export type BumpEvent = eventUtils.BumpEvent; -export const BUMP_EVENTS = eventUtils.BUMP_EVENTS; -export const CHANGE = eventUtils.CHANGE; -export const CLICK = eventUtils.CLICK; -export const COMMENT_CHANGE = eventUtils.COMMENT_CHANGE; -export const COMMENT_CREATE = eventUtils.COMMENT_CREATE; -export const COMMENT_DELETE = eventUtils.COMMENT_DELETE; -export const COMMENT_MOVE = eventUtils.COMMENT_MOVE; -export const COMMENT_RESIZE = eventUtils.COMMENT_RESIZE; -export const COMMENT_DRAG = eventUtils.COMMENT_DRAG; -export const CREATE = eventUtils.CREATE; -export const DELETE = eventUtils.DELETE; -export const FINISHED_LOADING = eventUtils.FINISHED_LOADING; -export const MARKER_MOVE = eventUtils.MARKER_MOVE; -export const MOVE = eventUtils.MOVE; -export const SELECTED = eventUtils.SELECTED; -export const THEME_CHANGE = eventUtils.THEME_CHANGE; -export const TOOLBOX_ITEM_SELECT = eventUtils.TOOLBOX_ITEM_SELECT; -export const TRASHCAN_OPEN = eventUtils.TRASHCAN_OPEN; -export const UI = eventUtils.UI; -export const VAR_CREATE = eventUtils.VAR_CREATE; -export const VAR_DELETE = eventUtils.VAR_DELETE; -export const VAR_RENAME = eventUtils.VAR_RENAME; -export const VIEWPORT_CHANGE = eventUtils.VIEWPORT_CHANGE; + EventType.BLOCK_FIELD_INTERMEDIATE_CHANGE; +export const BUBBLE_OPEN = EventType.BUBBLE_OPEN; +/** @deprecated Use BLOCK_CHANGE instead */ +export const CHANGE = EventType.BLOCK_CHANGE; +export const CLICK = EventType.CLICK; +export const COMMENT_CHANGE = EventType.COMMENT_CHANGE; +export const COMMENT_CREATE = EventType.COMMENT_CREATE; +export const COMMENT_DELETE = EventType.COMMENT_DELETE; +export const COMMENT_MOVE = EventType.COMMENT_MOVE; +export const COMMENT_RESIZE = EventType.COMMENT_RESIZE; +export const COMMENT_DRAG = EventType.COMMENT_DRAG; +/** @deprecated Use BLOCK_CREATE instead */ +export const CREATE = EventType.BLOCK_CREATE; +/** @deprecated Use BLOCK_DELETE instead */ +export const DELETE = EventType.BLOCK_DELETE; +export const FINISHED_LOADING = EventType.FINISHED_LOADING; +export const MARKER_MOVE = EventType.MARKER_MOVE; +/** @deprecated Use BLOCK_MOVE instead */ +export const MOVE = EventType.BLOCK_MOVE; +export const SELECTED = EventType.SELECTED; +export const THEME_CHANGE = EventType.THEME_CHANGE; +export const TOOLBOX_ITEM_SELECT = EventType.TOOLBOX_ITEM_SELECT; +export const TRASHCAN_OPEN = EventType.TRASHCAN_OPEN; +export const UI = EventType.UI; +export const VAR_CREATE = EventType.VAR_CREATE; +export const VAR_DELETE = EventType.VAR_DELETE; +export const VAR_RENAME = EventType.VAR_RENAME; +export const VIEWPORT_CHANGE = EventType.VIEWPORT_CHANGE; + +export {BUMP_EVENTS} from './type.js'; // Event utils. -export const clearPendingUndo = eventUtils.clearPendingUndo; -export const disable = eventUtils.disable; -export const enable = eventUtils.enable; -export const filter = eventUtils.filter; -export const fire = eventUtils.fire; -export const fromJson = eventUtils.fromJson; -export const getDescendantIds = eventUtils.getDescendantIds; -export const get = eventUtils.get; -export const getGroup = eventUtils.getGroup; -export const getRecordUndo = eventUtils.getRecordUndo; -export const isEnabled = eventUtils.isEnabled; -export const setGroup = eventUtils.setGroup; -export const setRecordUndo = eventUtils.setRecordUndo; -export const disableOrphans = eventUtils.disableOrphans; +export { + clearPendingUndo, + disable, + disableOrphans, + enable, + filter, + fire, + fromJson, + get, + getDescendantIds, + getGroup, + getRecordUndo, + isEnabled, + setGroup, + setRecordUndo, +} from './utils.js'; diff --git a/core/events/events_abstract.ts b/core/events/events_abstract.ts index b63c742b5..e5a77dc7d 100644 --- a/core/events/events_abstract.ts +++ b/core/events/events_abstract.ts @@ -14,7 +14,7 @@ import * as common from '../common.js'; import type {Workspace} from '../workspace.js'; -import * as eventUtils from './utils.js'; +import {getGroup, getRecordUndo} from './utils.js'; /** * Abstract class for an event. @@ -47,8 +47,8 @@ export abstract class Abstract { type = ''; constructor() { - this.group = eventUtils.getGroup(); - this.recordUndo = eventUtils.getRecordUndo(); + this.group = getGroup(); + this.recordUndo = getRecordUndo(); } /** diff --git a/core/events/events_block_change.ts b/core/events/events_block_change.ts index 103dc3427..e71eabb17 100644 --- a/core/events/events_block_change.ts +++ b/core/events/events_block_change.ts @@ -21,6 +21,7 @@ import * as utilsXml from '../utils/xml.js'; import {Workspace} from '../workspace.js'; import * as Xml from '../xml.js'; import {BlockBase, BlockBaseJson} from './events_block_base.js'; +import {EventType} from './type.js'; import * as eventUtils from './utils.js'; /** @@ -28,7 +29,7 @@ import * as eventUtils from './utils.js'; * field values, comments, etc). */ export class BlockChange extends BlockBase { - override type = eventUtils.BLOCK_CHANGE; + override type = EventType.BLOCK_CHANGE; /** * The element that changed; one of 'field', 'comment', 'collapsed', * 'disabled', 'inline', or 'mutation' @@ -255,4 +256,4 @@ export interface BlockChangeJson extends BlockBaseJson { disabledReason?: string; } -registry.register(registry.Type.EVENT, eventUtils.CHANGE, BlockChange); +registry.register(registry.Type.EVENT, EventType.BLOCK_CHANGE, BlockChange); diff --git a/core/events/events_block_create.ts b/core/events/events_block_create.ts index 6f14a8117..ca6979454 100644 --- a/core/events/events_block_create.ts +++ b/core/events/events_block_create.ts @@ -18,6 +18,7 @@ import * as utilsXml from '../utils/xml.js'; import {Workspace} from '../workspace.js'; import * as Xml from '../xml.js'; import {BlockBase, BlockBaseJson} from './events_block_base.js'; +import {EventType} from './type.js'; import * as eventUtils from './utils.js'; /** @@ -25,7 +26,7 @@ import * as eventUtils from './utils.js'; * created. */ export class BlockCreate extends BlockBase { - override type = eventUtils.BLOCK_CREATE; + override type = EventType.BLOCK_CREATE; /** The XML representation of the created block(s). */ xml?: Element | DocumentFragment; @@ -181,4 +182,4 @@ export interface BlockCreateJson extends BlockBaseJson { recordUndo?: boolean; } -registry.register(registry.Type.EVENT, eventUtils.CREATE, BlockCreate); +registry.register(registry.Type.EVENT, EventType.BLOCK_CREATE, BlockCreate); diff --git a/core/events/events_block_delete.ts b/core/events/events_block_delete.ts index e1c04f365..5dd231606 100644 --- a/core/events/events_block_delete.ts +++ b/core/events/events_block_delete.ts @@ -18,6 +18,7 @@ import * as utilsXml from '../utils/xml.js'; import {Workspace} from '../workspace.js'; import * as Xml from '../xml.js'; import {BlockBase, BlockBaseJson} from './events_block_base.js'; +import {EventType} from './type.js'; import * as eventUtils from './utils.js'; /** @@ -37,7 +38,7 @@ export class BlockDelete extends BlockBase { /** True if the deleted block was a shadow block, false otherwise. */ wasShadow?: boolean; - override type = eventUtils.BLOCK_DELETE; + override type = EventType.BLOCK_DELETE; /** @param opt_block The deleted block. Undefined for a blank event. */ constructor(opt_block?: Block) { @@ -178,4 +179,4 @@ export interface BlockDeleteJson extends BlockBaseJson { recordUndo?: boolean; } -registry.register(registry.Type.EVENT, eventUtils.DELETE, BlockDelete); +registry.register(registry.Type.EVENT, EventType.BLOCK_DELETE, BlockDelete); diff --git a/core/events/events_block_drag.ts b/core/events/events_block_drag.ts index 0045d2bec..4a91c4d11 100644 --- a/core/events/events_block_drag.ts +++ b/core/events/events_block_drag.ts @@ -16,7 +16,7 @@ import * as registry from '../registry.js'; import {Workspace} from '../workspace.js'; import {AbstractEventJson} from './events_abstract.js'; import {UiBase} from './events_ui_base.js'; -import * as eventUtils from './utils.js'; +import {EventType} from './type.js'; /** * Notifies listeners when a block is being manually dragged/dropped. @@ -34,7 +34,7 @@ export class BlockDrag extends UiBase { */ blocks?: Block[]; - override type = eventUtils.BLOCK_DRAG; + override type = EventType.BLOCK_DRAG; /** * @param opt_block The top block in the stack that is being dragged. @@ -113,4 +113,4 @@ export interface BlockDragJson extends AbstractEventJson { blocks?: Block[]; } -registry.register(registry.Type.EVENT, eventUtils.BLOCK_DRAG, BlockDrag); +registry.register(registry.Type.EVENT, EventType.BLOCK_DRAG, BlockDrag); diff --git a/core/events/events_block_field_intermediate_change.ts b/core/events/events_block_field_intermediate_change.ts index ef077a97a..49280cf2b 100644 --- a/core/events/events_block_field_intermediate_change.ts +++ b/core/events/events_block_field_intermediate_change.ts @@ -16,7 +16,7 @@ import type {Block} from '../block.js'; import * as registry from '../registry.js'; import {Workspace} from '../workspace.js'; import {BlockBase, BlockBaseJson} from './events_block_base.js'; -import * as eventUtils from './utils.js'; +import {EventType} from './type.js'; /** * Notifies listeners when the value of a block's field has changed but the @@ -24,7 +24,7 @@ import * as eventUtils from './utils.js'; * event. */ export class BlockFieldIntermediateChange extends BlockBase { - override type = eventUtils.BLOCK_FIELD_INTERMEDIATE_CHANGE; + override type = EventType.BLOCK_FIELD_INTERMEDIATE_CHANGE; // Intermediate events do not undo or redo. They may be fired frequently while // the field editor widget is open. A separate BLOCK_CHANGE event is fired @@ -161,6 +161,6 @@ export interface BlockFieldIntermediateChangeJson extends BlockBaseJson { registry.register( registry.Type.EVENT, - eventUtils.BLOCK_FIELD_INTERMEDIATE_CHANGE, + EventType.BLOCK_FIELD_INTERMEDIATE_CHANGE, BlockFieldIntermediateChange, ); diff --git a/core/events/events_block_move.ts b/core/events/events_block_move.ts index 233880eef..cd683a777 100644 --- a/core/events/events_block_move.ts +++ b/core/events/events_block_move.ts @@ -17,7 +17,7 @@ import * as registry from '../registry.js'; import {Coordinate} from '../utils/coordinate.js'; import type {Workspace} from '../workspace.js'; import {BlockBase, BlockBaseJson} from './events_block_base.js'; -import * as eventUtils from './utils.js'; +import {EventType} from './type.js'; interface BlockLocation { parentId?: string; @@ -30,7 +30,7 @@ interface BlockLocation { * connection to another, or from one location on the workspace to another. */ export class BlockMove extends BlockBase { - override type = eventUtils.BLOCK_MOVE; + override type = EventType.BLOCK_MOVE; /** The ID of the old parent block. Undefined if it was a top-level block. */ oldParentId?: string; @@ -303,4 +303,4 @@ export interface BlockMoveJson extends BlockBaseJson { recordUndo?: boolean; } -registry.register(registry.Type.EVENT, eventUtils.MOVE, BlockMove); +registry.register(registry.Type.EVENT, EventType.BLOCK_MOVE, BlockMove); diff --git a/core/events/events_bubble_open.ts b/core/events/events_bubble_open.ts index fa9b43d25..a36bbcd6a 100644 --- a/core/events/events_bubble_open.ts +++ b/core/events/events_bubble_open.ts @@ -9,6 +9,7 @@ * * @class */ + // Former goog.module ID: Blockly.Events.BubbleOpen import type {BlockSvg} from '../block_svg.js'; @@ -16,7 +17,7 @@ import * as registry from '../registry.js'; import type {Workspace} from '../workspace.js'; import type {AbstractEventJson} from './events_abstract.js'; import {UiBase} from './events_ui_base.js'; -import * as eventUtils from './utils.js'; +import {EventType} from './type.js'; /** * Class for a bubble open event. @@ -31,7 +32,7 @@ export class BubbleOpen extends UiBase { /** The type of bubble; one of 'mutator', 'comment', or 'warning'. */ bubbleType?: BubbleType; - override type = eventUtils.BUBBLE_OPEN; + override type = EventType.BUBBLE_OPEN; /** * @param opt_block The associated block. Undefined for a blank event. @@ -117,4 +118,4 @@ export interface BubbleOpenJson extends AbstractEventJson { blockId: string; } -registry.register(registry.Type.EVENT, eventUtils.BUBBLE_OPEN, BubbleOpen); +registry.register(registry.Type.EVENT, EventType.BUBBLE_OPEN, BubbleOpen); diff --git a/core/events/events_click.ts b/core/events/events_click.ts index ada1ebc3e..c023f20f1 100644 --- a/core/events/events_click.ts +++ b/core/events/events_click.ts @@ -9,6 +9,7 @@ * * @class */ + // Former goog.module ID: Blockly.Events.Click import type {Block} from '../block.js'; @@ -16,7 +17,7 @@ import * as registry from '../registry.js'; import {Workspace} from '../workspace.js'; import {AbstractEventJson} from './events_abstract.js'; import {UiBase} from './events_ui_base.js'; -import * as eventUtils from './utils.js'; +import {EventType} from './type.js'; /** * Notifies listeners that some blockly element was clicked. @@ -30,7 +31,7 @@ export class Click extends UiBase { * or 'zoom_controls'. */ targetType?: ClickTarget; - override type = eventUtils.CLICK; + override type = EventType.CLICK; /** * @param opt_block The affected block. Null for click events that do not have @@ -106,4 +107,4 @@ export interface ClickJson extends AbstractEventJson { blockId?: string; } -registry.register(registry.Type.EVENT, eventUtils.CLICK, Click); +registry.register(registry.Type.EVENT, EventType.CLICK, Click); diff --git a/core/events/events_comment_base.ts b/core/events/events_comment_base.ts index afda026f2..e4b76c8e5 100644 --- a/core/events/events_comment_base.ts +++ b/core/events/events_comment_base.ts @@ -20,7 +20,7 @@ import { } from './events_abstract.js'; import type {CommentCreate} from './events_comment_create.js'; import type {CommentDelete} from './events_comment_delete.js'; -import * as eventUtils from './utils.js'; +import {getGroup, getRecordUndo} from './utils.js'; /** * Abstract class for a comment event. @@ -44,8 +44,8 @@ export class CommentBase extends AbstractEvent { this.commentId = opt_comment.id; this.workspaceId = opt_comment.workspace.id; - this.group = eventUtils.getGroup(); - this.recordUndo = eventUtils.getRecordUndo(); + this.group = getGroup(); + this.recordUndo = getRecordUndo(); } /** diff --git a/core/events/events_comment_change.ts b/core/events/events_comment_change.ts index ca807a6d2..4d944ea39 100644 --- a/core/events/events_comment_change.ts +++ b/core/events/events_comment_change.ts @@ -15,13 +15,13 @@ import type {WorkspaceComment} from '../comments/workspace_comment.js'; import * as registry from '../registry.js'; import type {Workspace} from '../workspace.js'; import {CommentBase, CommentBaseJson} from './events_comment_base.js'; -import * as eventUtils from './utils.js'; +import {EventType} from './type.js'; /** * Notifies listeners that the contents of a workspace comment has changed. */ export class CommentChange extends CommentBase { - override type = eventUtils.COMMENT_CHANGE; + override type = EventType.COMMENT_CHANGE; // TODO(#6774): We should remove underscores. /** The previous contents of the comment. */ @@ -153,8 +153,4 @@ export interface CommentChangeJson extends CommentBaseJson { newContents: string; } -registry.register( - registry.Type.EVENT, - eventUtils.COMMENT_CHANGE, - CommentChange, -); +registry.register(registry.Type.EVENT, EventType.COMMENT_CHANGE, CommentChange); diff --git a/core/events/events_comment_collapse.ts b/core/events/events_comment_collapse.ts index 30147f3d8..0f718a040 100644 --- a/core/events/events_comment_collapse.ts +++ b/core/events/events_comment_collapse.ts @@ -8,10 +8,10 @@ import {WorkspaceComment} from '../comments/workspace_comment.js'; import * as registry from '../registry.js'; import type {Workspace} from '../workspace.js'; import {CommentBase, CommentBaseJson} from './events_comment_base.js'; -import * as eventUtils from './utils.js'; +import {EventType} from './type.js'; export class CommentCollapse extends CommentBase { - override type = eventUtils.COMMENT_COLLAPSE; + override type = EventType.COMMENT_COLLAPSE; constructor( comment?: WorkspaceComment, @@ -98,6 +98,6 @@ export interface CommentCollapseJson extends CommentBaseJson { registry.register( registry.Type.EVENT, - eventUtils.COMMENT_COLLAPSE, + EventType.COMMENT_COLLAPSE, CommentCollapse, ); diff --git a/core/events/events_comment_create.ts b/core/events/events_comment_create.ts index b4ee7ad71..637107e3f 100644 --- a/core/events/events_comment_create.ts +++ b/core/events/events_comment_create.ts @@ -18,13 +18,13 @@ import * as utilsXml from '../utils/xml.js'; import type {Workspace} from '../workspace.js'; import * as Xml from '../xml.js'; import {CommentBase, CommentBaseJson} from './events_comment_base.js'; -import * as eventUtils from './utils.js'; +import {EventType} from './type.js'; /** * Notifies listeners that a workspace comment was created. */ export class CommentCreate extends CommentBase { - override type = eventUtils.COMMENT_CREATE; + override type = EventType.COMMENT_CREATE; /** The XML representation of the created workspace comment. */ xml?: Element | DocumentFragment; @@ -111,8 +111,4 @@ export interface CommentCreateJson extends CommentBaseJson { json: object; } -registry.register( - registry.Type.EVENT, - eventUtils.COMMENT_CREATE, - CommentCreate, -); +registry.register(registry.Type.EVENT, EventType.COMMENT_CREATE, CommentCreate); diff --git a/core/events/events_comment_delete.ts b/core/events/events_comment_delete.ts index a429ab824..579131e50 100644 --- a/core/events/events_comment_delete.ts +++ b/core/events/events_comment_delete.ts @@ -18,13 +18,13 @@ import * as utilsXml from '../utils/xml.js'; import type {Workspace} from '../workspace.js'; import * as Xml from '../xml.js'; import {CommentBase, CommentBaseJson} from './events_comment_base.js'; -import * as eventUtils from './utils.js'; +import {EventType} from './type.js'; /** * Notifies listeners that a workspace comment has been deleted. */ export class CommentDelete extends CommentBase { - override type = eventUtils.COMMENT_DELETE; + override type = EventType.COMMENT_DELETE; /** The XML representation of the deleted workspace comment. */ xml?: Element; @@ -110,8 +110,4 @@ export interface CommentDeleteJson extends CommentBaseJson { json: object; } -registry.register( - registry.Type.EVENT, - eventUtils.COMMENT_DELETE, - CommentDelete, -); +registry.register(registry.Type.EVENT, EventType.COMMENT_DELETE, CommentDelete); diff --git a/core/events/events_comment_drag.ts b/core/events/events_comment_drag.ts index 7ca21d4dc..b25ca5b73 100644 --- a/core/events/events_comment_drag.ts +++ b/core/events/events_comment_drag.ts @@ -13,7 +13,7 @@ import * as registry from '../registry.js'; import {Workspace} from '../workspace.js'; import {AbstractEventJson} from './events_abstract.js'; import {UiBase} from './events_ui_base.js'; -import * as eventUtils from './utils.js'; +import {EventType} from './type.js'; /** * Notifies listeners when a comment is being manually dragged/dropped. @@ -25,7 +25,7 @@ export class CommentDrag extends UiBase { /** True if this is the start of a drag, false if this is the end of one. */ isStart?: boolean; - override type = eventUtils.COMMENT_DRAG; + override type = EventType.COMMENT_DRAG; /** * @param opt_comment The comment that is being dragged. @@ -96,4 +96,4 @@ export interface CommentDragJson extends AbstractEventJson { commentId: string; } -registry.register(registry.Type.EVENT, eventUtils.COMMENT_DRAG, CommentDrag); +registry.register(registry.Type.EVENT, EventType.COMMENT_DRAG, CommentDrag); diff --git a/core/events/events_comment_move.ts b/core/events/events_comment_move.ts index d50efec5a..af5e33616 100644 --- a/core/events/events_comment_move.ts +++ b/core/events/events_comment_move.ts @@ -16,13 +16,13 @@ import * as registry from '../registry.js'; import {Coordinate} from '../utils/coordinate.js'; import type {Workspace} from '../workspace.js'; import {CommentBase, CommentBaseJson} from './events_comment_base.js'; -import * as eventUtils from './utils.js'; +import {EventType} from './type.js'; /** * Notifies listeners that a workspace comment has moved. */ export class CommentMove extends CommentBase { - override type = eventUtils.COMMENT_MOVE; + override type = EventType.COMMENT_MOVE; /** The comment that is being moved. */ comment_?: WorkspaceComment; @@ -203,4 +203,4 @@ export interface CommentMoveJson extends CommentBaseJson { newCoordinate: string; } -registry.register(registry.Type.EVENT, eventUtils.COMMENT_MOVE, CommentMove); +registry.register(registry.Type.EVENT, EventType.COMMENT_MOVE, CommentMove); diff --git a/core/events/events_comment_resize.ts b/core/events/events_comment_resize.ts index 623e0c415..0c59177d9 100644 --- a/core/events/events_comment_resize.ts +++ b/core/events/events_comment_resize.ts @@ -13,13 +13,13 @@ import * as registry from '../registry.js'; import {Size} from '../utils/size.js'; import type {Workspace} from '../workspace.js'; import {CommentBase, CommentBaseJson} from './events_comment_base.js'; -import * as eventUtils from './utils.js'; +import {EventType} from './type.js'; /** * Notifies listeners that a workspace comment has resized. */ export class CommentResize extends CommentBase { - override type = eventUtils.COMMENT_RESIZE; + override type = EventType.COMMENT_RESIZE; /** The size of the comment before the resize. */ oldSize?: Size; @@ -166,8 +166,4 @@ export interface CommentResizeJson extends CommentBaseJson { newHeight: number; } -registry.register( - registry.Type.EVENT, - eventUtils.COMMENT_RESIZE, - CommentResize, -); +registry.register(registry.Type.EVENT, EventType.COMMENT_RESIZE, CommentResize); diff --git a/core/events/events_marker_move.ts b/core/events/events_marker_move.ts index e5c7dc47d..58309df58 100644 --- a/core/events/events_marker_move.ts +++ b/core/events/events_marker_move.ts @@ -17,7 +17,7 @@ import * as registry from '../registry.js'; import type {Workspace} from '../workspace.js'; import {AbstractEventJson} from './events_abstract.js'; import {UiBase} from './events_ui_base.js'; -import * as eventUtils from './utils.js'; +import {EventType} from './type.js'; /** * Notifies listeners that a marker (used for keyboard navigation) has @@ -40,7 +40,7 @@ export class MarkerMove extends UiBase { */ isCursor?: boolean; - override type = eventUtils.MARKER_MOVE; + override type = EventType.MARKER_MOVE; /** * @param opt_block The affected block. Null if current node is of type @@ -130,4 +130,4 @@ export interface MarkerMoveJson extends AbstractEventJson { newNode: ASTNode; } -registry.register(registry.Type.EVENT, eventUtils.MARKER_MOVE, MarkerMove); +registry.register(registry.Type.EVENT, EventType.MARKER_MOVE, MarkerMove); diff --git a/core/events/events_selected.ts b/core/events/events_selected.ts index 1892dcb18..e4a777496 100644 --- a/core/events/events_selected.ts +++ b/core/events/events_selected.ts @@ -15,7 +15,7 @@ import * as registry from '../registry.js'; import type {Workspace} from '../workspace.js'; import {AbstractEventJson} from './events_abstract.js'; import {UiBase} from './events_ui_base.js'; -import * as eventUtils from './utils.js'; +import {EventType} from './type.js'; /** * Class for a selected event. @@ -31,7 +31,7 @@ export class Selected extends UiBase { */ newElementId?: string; - override type = eventUtils.SELECTED; + override type = EventType.SELECTED; /** * @param opt_oldElementId The ID of the previously selected element. Null if @@ -94,4 +94,4 @@ export interface SelectedJson extends AbstractEventJson { newElementId?: string; } -registry.register(registry.Type.EVENT, eventUtils.SELECTED, Selected); +registry.register(registry.Type.EVENT, EventType.SELECTED, Selected); diff --git a/core/events/events_theme_change.ts b/core/events/events_theme_change.ts index c92aa0b7e..b142b9f14 100644 --- a/core/events/events_theme_change.ts +++ b/core/events/events_theme_change.ts @@ -15,7 +15,7 @@ import * as registry from '../registry.js'; import type {Workspace} from '../workspace.js'; import {AbstractEventJson} from './events_abstract.js'; import {UiBase} from './events_ui_base.js'; -import * as eventUtils from './utils.js'; +import {EventType} from './type.js'; /** * Notifies listeners that the workspace theme has changed. @@ -24,7 +24,7 @@ export class ThemeChange extends UiBase { /** The name of the new theme that has been set. */ themeName?: string; - override type = eventUtils.THEME_CHANGE; + override type = EventType.THEME_CHANGE; /** * @param opt_themeName The theme name. Undefined for a blank event. @@ -81,4 +81,4 @@ export interface ThemeChangeJson extends AbstractEventJson { themeName: string; } -registry.register(registry.Type.EVENT, eventUtils.THEME_CHANGE, ThemeChange); +registry.register(registry.Type.EVENT, EventType.THEME_CHANGE, ThemeChange); diff --git a/core/events/events_toolbox_item_select.ts b/core/events/events_toolbox_item_select.ts index f462addf3..6a93dbfde 100644 --- a/core/events/events_toolbox_item_select.ts +++ b/core/events/events_toolbox_item_select.ts @@ -15,7 +15,7 @@ import * as registry from '../registry.js'; import type {Workspace} from '../workspace.js'; import {AbstractEventJson} from './events_abstract.js'; import {UiBase} from './events_ui_base.js'; -import * as eventUtils from './utils.js'; +import {EventType} from './type.js'; /** * Notifies listeners that a toolbox item has been selected. @@ -27,7 +27,7 @@ export class ToolboxItemSelect extends UiBase { /** The newly selected toolbox item. */ newItem?: string; - override type = eventUtils.TOOLBOX_ITEM_SELECT; + override type = EventType.TOOLBOX_ITEM_SELECT; /** * @param opt_oldItem The previously selected toolbox item. @@ -91,6 +91,6 @@ export interface ToolboxItemSelectJson extends AbstractEventJson { registry.register( registry.Type.EVENT, - eventUtils.TOOLBOX_ITEM_SELECT, + EventType.TOOLBOX_ITEM_SELECT, ToolboxItemSelect, ); diff --git a/core/events/events_trashcan_open.ts b/core/events/events_trashcan_open.ts index bbd5d2dd9..af06d9f8f 100644 --- a/core/events/events_trashcan_open.ts +++ b/core/events/events_trashcan_open.ts @@ -15,7 +15,7 @@ import * as registry from '../registry.js'; import type {Workspace} from '../workspace.js'; import {AbstractEventJson} from './events_abstract.js'; import {UiBase} from './events_ui_base.js'; -import * as eventUtils from './utils.js'; +import {EventType} from './type.js'; /** * Notifies listeners when the trashcan is opening or closing. @@ -26,7 +26,7 @@ export class TrashcanOpen extends UiBase { * False if it is currently closing (previously open). */ isOpen?: boolean; - override type = eventUtils.TRASHCAN_OPEN; + override type = EventType.TRASHCAN_OPEN; /** * @param opt_isOpen Whether the trashcan flyout is opening (false if @@ -84,4 +84,4 @@ export interface TrashcanOpenJson extends AbstractEventJson { isOpen: boolean; } -registry.register(registry.Type.EVENT, eventUtils.TRASHCAN_OPEN, TrashcanOpen); +registry.register(registry.Type.EVENT, EventType.TRASHCAN_OPEN, TrashcanOpen); diff --git a/core/events/events_var_create.ts b/core/events/events_var_create.ts index 6376e1a61..b3ae548aa 100644 --- a/core/events/events_var_create.ts +++ b/core/events/events_var_create.ts @@ -15,13 +15,13 @@ import * as registry from '../registry.js'; import type {VariableModel} from '../variable_model.js'; import type {Workspace} from '../workspace.js'; import {VarBase, VarBaseJson} from './events_var_base.js'; -import * as eventUtils from './utils.js'; +import {EventType} from './type.js'; /** * Notifies listeners that a variable model has been created. */ export class VarCreate extends VarBase { - override type = eventUtils.VAR_CREATE; + override type = EventType.VAR_CREATE; /** The type of the variable that was created. */ varType?: string; @@ -122,4 +122,4 @@ export interface VarCreateJson extends VarBaseJson { varName: string; } -registry.register(registry.Type.EVENT, eventUtils.VAR_CREATE, VarCreate); +registry.register(registry.Type.EVENT, EventType.VAR_CREATE, VarCreate); diff --git a/core/events/events_var_delete.ts b/core/events/events_var_delete.ts index 125269791..caaa1f487 100644 --- a/core/events/events_var_delete.ts +++ b/core/events/events_var_delete.ts @@ -10,7 +10,7 @@ import * as registry from '../registry.js'; import type {VariableModel} from '../variable_model.js'; import type {Workspace} from '../workspace.js'; import {VarBase, VarBaseJson} from './events_var_base.js'; -import * as eventUtils from './utils.js'; +import {EventType} from './type.js'; /** * Notifies listeners that a variable model has been deleted. @@ -18,7 +18,7 @@ import * as eventUtils from './utils.js'; * @class */ export class VarDelete extends VarBase { - override type = eventUtils.VAR_DELETE; + override type = EventType.VAR_DELETE; /** The type of the variable that was deleted. */ varType?: string; /** The name of the variable that was deleted. */ @@ -117,4 +117,4 @@ export interface VarDeleteJson extends VarBaseJson { varName: string; } -registry.register(registry.Type.EVENT, eventUtils.VAR_DELETE, VarDelete); +registry.register(registry.Type.EVENT, EventType.VAR_DELETE, VarDelete); diff --git a/core/events/events_var_rename.ts b/core/events/events_var_rename.ts index 268d6abc9..b461184ca 100644 --- a/core/events/events_var_rename.ts +++ b/core/events/events_var_rename.ts @@ -10,7 +10,7 @@ import * as registry from '../registry.js'; import type {VariableModel} from '../variable_model.js'; import type {Workspace} from '../workspace.js'; import {VarBase, VarBaseJson} from './events_var_base.js'; -import * as eventUtils from './utils.js'; +import {EventType} from './type.js'; /** * Notifies listeners that a variable model was renamed. @@ -18,7 +18,7 @@ import * as eventUtils from './utils.js'; * @class */ export class VarRename extends VarBase { - override type = eventUtils.VAR_RENAME; + override type = EventType.VAR_RENAME; /** The previous name of the variable. */ oldName?: string; @@ -126,4 +126,4 @@ export interface VarRenameJson extends VarBaseJson { newName: string; } -registry.register(registry.Type.EVENT, eventUtils.VAR_RENAME, VarRename); +registry.register(registry.Type.EVENT, EventType.VAR_RENAME, VarRename); diff --git a/core/events/events_viewport.ts b/core/events/events_viewport.ts index 243477099..b7a05b8d6 100644 --- a/core/events/events_viewport.ts +++ b/core/events/events_viewport.ts @@ -15,7 +15,7 @@ import * as registry from '../registry.js'; import type {Workspace} from '../workspace.js'; import {AbstractEventJson} from './events_abstract.js'; import {UiBase} from './events_ui_base.js'; -import * as eventUtils from './utils.js'; +import {EventType} from './type.js'; /** * Notifies listeners that the workspace surface's position or scale has @@ -42,7 +42,7 @@ export class ViewportChange extends UiBase { /** The previous scale of the workspace. */ oldScale?: number; - override type = eventUtils.VIEWPORT_CHANGE; + override type = EventType.VIEWPORT_CHANGE; /** * @param opt_top Top-edge of the visible portion of the workspace, relative @@ -144,6 +144,6 @@ export interface ViewportChangeJson extends AbstractEventJson { registry.register( registry.Type.EVENT, - eventUtils.VIEWPORT_CHANGE, + EventType.VIEWPORT_CHANGE, ViewportChange, ); diff --git a/core/events/type.ts b/core/events/type.ts new file mode 100644 index 000000000..71060efbb --- /dev/null +++ b/core/events/type.ts @@ -0,0 +1,85 @@ +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * Enum of values for the .type property for event classes (concrete subclasses + * of Abstract). + */ +export enum EventType { + /** Type of event that creates a block. */ + BLOCK_CREATE = 'create', + /** Type of event that deletes a block. */ + BLOCK_DELETE = 'delete', + /** Type of event that changes a block. */ + BLOCK_CHANGE = 'change', + /** + * Type of event representing an in-progress change to a field of a + * block, which is expected to be followed by a block change event. + */ + BLOCK_FIELD_INTERMEDIATE_CHANGE = 'block_field_intermediate_change', + /** Type of event that moves a block. */ + BLOCK_MOVE = 'move', + /** Type of event that creates a variable. */ + VAR_CREATE = 'var_create', + /** Type of event that deletes a variable. */ + VAR_DELETE = 'var_delete', + /** Type of event that renames a variable. */ + VAR_RENAME = 'var_rename', + /** + * Type of generic event that records a UI change. + * + * @deprecated Was only ever intended for internal use. + */ + UI = 'ui', + /** Type of event that drags a block. */ + BLOCK_DRAG = 'drag', + /** Type of event that records a change in selected element. */ + SELECTED = 'selected', + /** Type of event that records a click. */ + CLICK = 'click', + /** Type of event that records a marker move. */ + MARKER_MOVE = 'marker_move', + /** Type of event that records a bubble open. */ + BUBBLE_OPEN = 'bubble_open', + /** Type of event that records a trashcan open. */ + TRASHCAN_OPEN = 'trashcan_open', + /** Type of event that records a toolbox item select. */ + TOOLBOX_ITEM_SELECT = 'toolbox_item_select', + /** Type of event that records a theme change. */ + THEME_CHANGE = 'theme_change', + /** Type of event that records a viewport change. */ + VIEWPORT_CHANGE = 'viewport_change', + /** Type of event that creates a comment. */ + COMMENT_CREATE = 'comment_create', + /** Type of event that deletes a comment. */ + COMMENT_DELETE = 'comment_delete', + /** Type of event that changes a comment. */ + COMMENT_CHANGE = 'comment_change', + /** Type of event that moves a comment. */ + COMMENT_MOVE = 'comment_move', + /** Type of event that resizes a comment. */ + COMMENT_RESIZE = 'comment_resize', + /** Type of event that drags a comment. */ + COMMENT_DRAG = 'comment_drag', + /** Type of event that collapses a comment. */ + COMMENT_COLLAPSE = 'comment_collapse', + /** Type of event that records a workspace load. */ + FINISHED_LOADING = 'finished_loading', +} + +/** + * List of events that cause objects to be bumped back into the visible + * portion of the workspace. + * + * Not to be confused with bumping so that disconnected connections do not + * appear connected. + */ +export const BUMP_EVENTS: string[] = [ + EventType.BLOCK_CREATE, + EventType.BLOCK_MOVE, + EventType.COMMENT_CREATE, + EventType.COMMENT_MOVE, +]; diff --git a/core/events/utils.ts b/core/events/utils.ts index 2e2701cf9..b320a7a8f 100644 --- a/core/events/utils.ts +++ b/core/events/utils.ts @@ -20,6 +20,7 @@ import type {CommentCreate} from './events_comment_create.js'; import type {CommentMove} from './events_comment_move.js'; import type {CommentResize} from './events_comment_resize.js'; import type {ViewportChange} from './events_viewport.js'; +import {EventType} from './type.js'; /** Group ID for new events. Grouped events are indivisible. */ let group = ''; @@ -48,152 +49,6 @@ export function getRecordUndo(): boolean { /** Allow change events to be created and fired. */ let disabled = 0; -/** - * Name of event that creates a block. Will be deprecated for BLOCK_CREATE. - */ -export const CREATE = 'create'; - -/** - * Name of event that creates a block. - */ -export const BLOCK_CREATE = CREATE; - -/** - * Name of event that deletes a block. Will be deprecated for BLOCK_DELETE. - */ -export const DELETE = 'delete'; - -/** - * Name of event that deletes a block. - */ -export const BLOCK_DELETE = DELETE; - -/** - * Name of event that changes a block. Will be deprecated for BLOCK_CHANGE. - */ -export const CHANGE = 'change'; - -/** - * Name of event that changes a block. - */ -export const BLOCK_CHANGE = CHANGE; - -/** - * Name of event representing an in-progress change to a field of a block, which - * is expected to be followed by a block change event. - */ -export const BLOCK_FIELD_INTERMEDIATE_CHANGE = - 'block_field_intermediate_change'; - -/** - * Name of event that moves a block. Will be deprecated for BLOCK_MOVE. - */ -export const MOVE = 'move'; - -/** - * Name of event that moves a block. - */ -export const BLOCK_MOVE = MOVE; - -/** - * Name of event that creates a variable. - */ -export const VAR_CREATE = 'var_create'; - -/** - * Name of event that deletes a variable. - */ -export const VAR_DELETE = 'var_delete'; - -/** - * Name of event that renames a variable. - */ -export const VAR_RENAME = 'var_rename'; - -/** - * Name of generic event that records a UI change. - */ -export const UI = 'ui'; - -/** - * Name of event that drags a block. - */ -export const BLOCK_DRAG = 'drag'; - -/** - * Name of event that records a change in selected element. - */ -export const SELECTED = 'selected'; - -/** - * Name of event that records a click. - */ -export const CLICK = 'click'; - -/** - * Name of event that records a marker move. - */ -export const MARKER_MOVE = 'marker_move'; - -/** - * Name of event that records a bubble open. - */ -export const BUBBLE_OPEN = 'bubble_open'; - -/** - * Name of event that records a trashcan open. - */ -export const TRASHCAN_OPEN = 'trashcan_open'; - -/** - * Name of event that records a toolbox item select. - */ -export const TOOLBOX_ITEM_SELECT = 'toolbox_item_select'; - -/** - * Name of event that records a theme change. - */ -export const THEME_CHANGE = 'theme_change'; - -/** - * Name of event that records a viewport change. - */ -export const VIEWPORT_CHANGE = 'viewport_change'; - -/** - * Name of event that creates a comment. - */ -export const COMMENT_CREATE = 'comment_create'; - -/** - * Name of event that deletes a comment. - */ -export const COMMENT_DELETE = 'comment_delete'; - -/** - * Name of event that changes a comment. - */ -export const COMMENT_CHANGE = 'comment_change'; - -/** - * Name of event that moves a comment. - */ -export const COMMENT_MOVE = 'comment_move'; - -/** Name of event that resizes a comment. */ -export const COMMENT_RESIZE = 'comment_resize'; - -/** Name of event that drags a comment. */ -export const COMMENT_DRAG = 'comment_drag'; - -/** Type of event that collapses a comment. */ -export const COMMENT_COLLAPSE = 'comment_collapse'; - -/** - * Name of event that records a workspace load. - */ -export const FINISHED_LOADING = 'finished_loading'; - /** * The language-neutral ID for when the reason why a block is disabled is * because the block is not descended from a root block. @@ -214,20 +69,6 @@ export type BumpEvent = | CommentMove | CommentResize; -/** - * List of events that cause objects to be bumped back into the visible - * portion of the workspace. - * - * Not to be confused with bumping so that disconnected connections do not - * appear connected. - */ -export const BUMP_EVENTS: string[] = [ - BLOCK_CREATE, - BLOCK_MOVE, - COMMENT_CREATE, - COMMENT_MOVE, -]; - /** List of events queued for firing. */ const FIRE_QUEUE: Abstract[] = []; @@ -339,7 +180,7 @@ export function filter(queueIn: Abstract[], forward: boolean): Abstract[] { for (let i = 0, event; (event = queue[i]); i++) { if (!event.isNull()) { // Treat all UI events as the same type in hash table. - const eventType = event.isUiEvent ? UI : event.type; + const eventType = event.isUiEvent ? EventType.UI : event.type; // TODO(#5927): Check whether `blockId` exists before accessing it. const blockId = (event as AnyDuringMigration).blockId; const key = [eventType, blockId, event.workspaceId].join(' '); @@ -352,7 +193,10 @@ export function filter(queueIn: Abstract[], forward: boolean): Abstract[] { // move events. hash[key] = {event, index: i}; mergedQueue.push(event); - } else if (event.type === MOVE && lastEntry.index === i - 1) { + } else if ( + event.type === EventType.BLOCK_MOVE && + lastEntry.index === i - 1 + ) { const moveEvent = event as BlockMove; // Merge move events. lastEvent.newParentId = moveEvent.newParentId; @@ -371,21 +215,24 @@ export function filter(queueIn: Abstract[], forward: boolean): Abstract[] { } lastEntry.index = i; } else if ( - event.type === CHANGE && + event.type === EventType.BLOCK_CHANGE && (event as BlockChange).element === lastEvent.element && (event as BlockChange).name === lastEvent.name ) { const changeEvent = event as BlockChange; // Merge change events. lastEvent.newValue = changeEvent.newValue; - } else if (event.type === VIEWPORT_CHANGE) { + } else if (event.type === EventType.VIEWPORT_CHANGE) { const viewportEvent = event as ViewportChange; // Merge viewport change events. lastEvent.viewTop = viewportEvent.viewTop; lastEvent.viewLeft = viewportEvent.viewLeft; lastEvent.scale = viewportEvent.scale; lastEvent.oldScale = viewportEvent.oldScale; - } else if (event.type === CLICK && lastEvent.type === BUBBLE_OPEN) { + } else if ( + event.type === EventType.CLICK && + lastEvent.type === EventType.BUBBLE_OPEN + ) { // Drop click events caused by opening/closing bubbles. } else { // Collision: newer events should merge into this event to maintain @@ -409,7 +256,7 @@ export function filter(queueIn: Abstract[], forward: boolean): Abstract[] { // AnyDuringMigration because: Property 'element' does not exist on type // 'Abstract'. if ( - event.type === CHANGE && + event.type === EventType.BLOCK_CHANGE && (event as AnyDuringMigration).element === 'mutation' ) { queue.unshift(queue.splice(i, 1)[0]); @@ -539,7 +386,10 @@ export function get( * @param event Custom data for event. */ export function disableOrphans(event: Abstract) { - if (event.type === MOVE || event.type === CREATE) { + if ( + event.type === EventType.BLOCK_MOVE || + event.type === EventType.BLOCK_CREATE + ) { const blockEvent = event as BlockMove | BlockCreate; if (!blockEvent.workspaceId) { return; diff --git a/core/events/workspace_events.ts b/core/events/workspace_events.ts index 225e342b4..1a2ff5473 100644 --- a/core/events/workspace_events.ts +++ b/core/events/workspace_events.ts @@ -14,7 +14,7 @@ import * as registry from '../registry.js'; import type {Workspace} from '../workspace.js'; import {Abstract as AbstractEvent} from './events_abstract.js'; -import * as eventUtils from './utils.js'; +import {EventType} from './type.js'; /** * Notifies listeners when the workspace has finished deserializing from @@ -23,7 +23,7 @@ import * as eventUtils from './utils.js'; export class FinishedLoading extends AbstractEvent { override isBlank = true; override recordUndo = false; - override type = eventUtils.FINISHED_LOADING; + override type = EventType.FINISHED_LOADING; /** * @param opt_workspace The workspace that has finished loading. Undefined @@ -41,6 +41,6 @@ export class FinishedLoading extends AbstractEvent { registry.register( registry.Type.EVENT, - eventUtils.FINISHED_LOADING, + EventType.FINISHED_LOADING, FinishedLoading, ); diff --git a/core/field.ts b/core/field.ts index 87a27f446..c9d3781a2 100644 --- a/core/field.ts +++ b/core/field.ts @@ -20,6 +20,7 @@ import type {Block} from './block.js'; import type {BlockSvg} from './block_svg.js'; import * as browserEvents from './browser_events.js'; import * as dropDownDiv from './dropdowndiv.js'; +import {EventType} from './events/type.js'; import * as eventUtils from './events/utils.js'; import type {Input} from './inputs/input.js'; import type {IASTNodeLocationSvg} from './interfaces/i_ast_node_location_svg.js'; @@ -1123,7 +1124,7 @@ export abstract class Field this.doValueUpdate_(localValue); if (fireChangeEvent && source && eventUtils.isEnabled()) { eventUtils.fire( - new (eventUtils.get(eventUtils.BLOCK_CHANGE))( + new (eventUtils.get(EventType.BLOCK_CHANGE))( source, 'field', this.name || null, diff --git a/core/field_input.ts b/core/field_input.ts index c3641f4f8..7ef5a01bc 100644 --- a/core/field_input.ts +++ b/core/field_input.ts @@ -19,6 +19,7 @@ import * as browserEvents from './browser_events.js'; import * as bumpObjects from './bump_objects.js'; import * as dialog from './dialog.js'; import * as dropDownDiv from './dropdowndiv.js'; +import {EventType} from './events/type.js'; import * as eventUtils from './events/utils.js'; import { Field, @@ -187,7 +188,7 @@ export abstract class FieldInput extends Field< fireChangeEvent ) { eventUtils.fire( - new (eventUtils.get(eventUtils.BLOCK_CHANGE))( + new (eventUtils.get(EventType.BLOCK_CHANGE))( this.sourceBlock_, 'field', this.name || null, @@ -475,7 +476,7 @@ export abstract class FieldInput extends Field< // multiple times while the editor was open, but this will fire an event // containing the value when the editor was opened as well as the new one. eventUtils.fire( - new (eventUtils.get(eventUtils.BLOCK_CHANGE))( + new (eventUtils.get(EventType.BLOCK_CHANGE))( this.sourceBlock_, 'field', this.name || null, @@ -592,7 +593,7 @@ export abstract class FieldInput extends Field< // Fire a special event indicating that the value changed but the change // isn't complete yet and normal field change listeners can wait. eventUtils.fire( - new (eventUtils.get(eventUtils.BLOCK_FIELD_INTERMEDIATE_CHANGE))( + new (eventUtils.get(EventType.BLOCK_FIELD_INTERMEDIATE_CHANGE))( this.sourceBlock_, this.name || null, oldValue, diff --git a/core/flyout_base.ts b/core/flyout_base.ts index 2a048a2c9..ccfb91ed0 100644 --- a/core/flyout_base.ts +++ b/core/flyout_base.ts @@ -19,6 +19,7 @@ import {ComponentManager} from './component_manager.js'; import {MANUALLY_DISABLED} from './constants.js'; import {DeleteArea} from './delete_area.js'; import type {Abstract as AbstractEvent} from './events/events_abstract.js'; +import {EventType} from './events/type.js'; import * as eventUtils from './events/utils.js'; import {FlyoutButton} from './flyout_button.js'; import {FlyoutMetricsManager} from './flyout_metrics_manager.js'; @@ -1138,13 +1139,13 @@ export abstract class Flyout for (let i = 0; i < newVariables.length; i++) { const thisVariable = newVariables[i]; eventUtils.fire( - new (eventUtils.get(eventUtils.VAR_CREATE))(thisVariable), + new (eventUtils.get(EventType.VAR_CREATE))(thisVariable), ); } // Block events come after var events, in case they refer to newly created // variables. - eventUtils.fire(new (eventUtils.get(eventUtils.BLOCK_CREATE))(newBlock)); + eventUtils.fire(new (eventUtils.get(EventType.BLOCK_CREATE))(newBlock)); } if (this.autoClose) { this.hide(); diff --git a/core/gesture.ts b/core/gesture.ts index a9a04e046..a71eb861e 100644 --- a/core/gesture.ts +++ b/core/gesture.ts @@ -22,6 +22,7 @@ import {RenderedWorkspaceComment} from './comments.js'; import * as common from './common.js'; import {config} from './config.js'; import * as dropDownDiv from './dropdowndiv.js'; +import {EventType} from './events/type.js'; import * as eventUtils from './events/utils.js'; import type {Field} from './field.js'; import type {IBubble} from './interfaces/i_bubble.js'; @@ -776,7 +777,7 @@ export class Gesture { */ private fireWorkspaceClick(ws: WorkspaceSvg) { eventUtils.fire( - new (eventUtils.get(eventUtils.CLICK))(null, ws.id, 'workspace'), + new (eventUtils.get(EventType.CLICK))(null, ws.id, 'workspace'), ); } @@ -909,7 +910,7 @@ export class Gesture { ); } // Clicks events are on the start block, even if it was a shadow. - const event = new (eventUtils.get(eventUtils.CLICK))( + const event = new (eventUtils.get(EventType.CLICK))( this.startBlock, this.startWorkspace_.id, 'block', diff --git a/core/icons/comment_icon.ts b/core/icons/comment_icon.ts index d06952b7a..7cf5431d7 100644 --- a/core/icons/comment_icon.ts +++ b/core/icons/comment_icon.ts @@ -10,6 +10,7 @@ import type {Block} from '../block.js'; import type {BlockSvg} from '../block_svg.js'; import {TextBubble} from '../bubbles/text_bubble.js'; import {TextInputBubble} from '../bubbles/textinput_bubble.js'; +import {EventType} from '../events/type.js'; import * as eventUtils from '../events/utils.js'; import type {IHasBubble} from '../interfaces/i_has_bubble.js'; import type {ISerializable} from '../interfaces/i_serializable.js'; @@ -159,7 +160,7 @@ export class CommentIcon extends Icon implements IHasBubble, ISerializable { setText(text: string) { const oldText = this.text; eventUtils.fire( - new (eventUtils.get(eventUtils.BLOCK_CHANGE))( + new (eventUtils.get(EventType.BLOCK_CHANGE))( this.sourceBlock, 'comment', null, @@ -238,7 +239,7 @@ export class CommentIcon extends Icon implements IHasBubble, ISerializable { if (this.text === newText) return; eventUtils.fire( - new (eventUtils.get(eventUtils.BLOCK_CHANGE))( + new (eventUtils.get(EventType.BLOCK_CHANGE))( this.sourceBlock, 'comment', null, @@ -288,7 +289,7 @@ export class CommentIcon extends Icon implements IHasBubble, ISerializable { } eventUtils.fire( - new (eventUtils.get(eventUtils.BUBBLE_OPEN))( + new (eventUtils.get(EventType.BUBBLE_OPEN))( this.sourceBlock, visible, 'comment', diff --git a/core/icons/mutator_icon.ts b/core/icons/mutator_icon.ts index 1aac847ca..5c137917a 100644 --- a/core/icons/mutator_icon.ts +++ b/core/icons/mutator_icon.ts @@ -11,6 +11,7 @@ import type {BlocklyOptions} from '../blockly_options.js'; import {MiniWorkspaceBubble} from '../bubbles/mini_workspace_bubble.js'; import type {Abstract} from '../events/events_abstract.js'; import {BlockChange} from '../events/events_block_change.js'; +import {EventType} from '../events/type.js'; import * as eventUtils from '../events/utils.js'; import type {IHasBubble} from '../interfaces/i_has_bubble.js'; import * as renderManagement from '../render_management.js'; @@ -193,7 +194,7 @@ export class MutatorIcon extends Icon implements IHasBubble { } eventUtils.fire( - new (eventUtils.get(eventUtils.BUBBLE_OPEN))( + new (eventUtils.get(EventType.BUBBLE_OPEN))( this.sourceBlock, visible, 'mutator', @@ -307,8 +308,8 @@ export class MutatorIcon extends Icon implements IHasBubble { static isIgnorableMutatorEvent(e: Abstract) { return ( e.isUiEvent || - e.type === eventUtils.CREATE || - (e.type === eventUtils.CHANGE && + e.type === EventType.BLOCK_CREATE || + (e.type === EventType.BLOCK_CHANGE && (e as BlockChange).element === 'disabled') ); } @@ -331,7 +332,7 @@ export class MutatorIcon extends Icon implements IHasBubble { if (oldExtraState !== newExtraState) { eventUtils.fire( - new (eventUtils.get(eventUtils.BLOCK_CHANGE))( + new (eventUtils.get(EventType.BLOCK_CHANGE))( this.sourceBlock, 'mutation', null, diff --git a/core/icons/warning_icon.ts b/core/icons/warning_icon.ts index 845094876..2744195f9 100644 --- a/core/icons/warning_icon.ts +++ b/core/icons/warning_icon.ts @@ -8,6 +8,7 @@ import type {BlockSvg} from '../block_svg.js'; import {TextBubble} from '../bubbles/text_bubble.js'; +import {EventType} from '../events/type.js'; import * as eventUtils from '../events/utils.js'; import type {IHasBubble} from '../interfaces/i_has_bubble.js'; import * as renderManagement from '../render_management.js'; @@ -188,7 +189,7 @@ export class WarningIcon extends Icon implements IHasBubble { } eventUtils.fire( - new (eventUtils.get(eventUtils.BUBBLE_OPEN))( + new (eventUtils.get(EventType.BUBBLE_OPEN))( this.sourceBlock, visible, 'warning', diff --git a/core/procedures.ts b/core/procedures.ts index 7ab62a91d..bad4ef05a 100644 --- a/core/procedures.ts +++ b/core/procedures.ts @@ -15,6 +15,7 @@ import {Blocks} from './blocks.js'; import * as common from './common.js'; import type {Abstract} from './events/events_abstract.js'; import type {BubbleOpen} from './events/events_bubble_open.js'; +import {EventType} from './events/type.js'; import * as eventUtils from './events/utils.js'; import {Field, UnattachedFieldError} from './field.js'; import {MutatorIcon} from './icons.js'; @@ -354,7 +355,7 @@ function updateMutatorFlyout(workspace: WorkspaceSvg) { * @internal */ export function mutatorOpenListener(e: Abstract) { - if (e.type !== eventUtils.BUBBLE_OPEN) { + if (e.type !== EventType.BUBBLE_OPEN) { return; } const bubbleEvent = e as BubbleOpen; @@ -386,10 +387,10 @@ export function mutatorOpenListener(e: Abstract) { */ function mutatorChangeListener(e: Abstract) { if ( - e.type !== eventUtils.BLOCK_CREATE && - e.type !== eventUtils.BLOCK_DELETE && - e.type !== eventUtils.BLOCK_CHANGE && - e.type !== eventUtils.BLOCK_FIELD_INTERMEDIATE_CHANGE + e.type !== EventType.BLOCK_CREATE && + e.type !== EventType.BLOCK_DELETE && + e.type !== EventType.BLOCK_CHANGE && + e.type !== EventType.BLOCK_FIELD_INTERMEDIATE_CHANGE ) { return; } @@ -454,7 +455,7 @@ export function mutateCallers(defBlock: Block) { // definition mutation. eventUtils.setRecordUndo(false); eventUtils.fire( - new (eventUtils.get(eventUtils.BLOCK_CHANGE))( + new (eventUtils.get(EventType.BLOCK_CHANGE))( caller, 'mutation', null, diff --git a/core/renderers/common/marker_svg.ts b/core/renderers/common/marker_svg.ts index 2eaee2aea..927c377f4 100644 --- a/core/renderers/common/marker_svg.ts +++ b/core/renderers/common/marker_svg.ts @@ -12,6 +12,7 @@ import '../../events/events_marker_move.js'; import type {BlockSvg} from '../../block_svg.js'; import type {Connection} from '../../connection.js'; import {ConnectionType} from '../../connection_type.js'; +import {EventType} from '../../events/type.js'; import * as eventUtils from '../../events/utils.js'; import type {Field} from '../../field.js'; import {FlyoutButton} from '../../flyout_button.js'; @@ -621,7 +622,7 @@ export class MarkerSvg { */ private fireMarkerEvent(oldNode: ASTNode, curNode: ASTNode) { const curBlock = curNode.getSourceBlock(); - const event = new (eventUtils.get(eventUtils.MARKER_MOVE))( + const event = new (eventUtils.get(EventType.MARKER_MOVE))( curBlock, this.isCursor(), oldNode, diff --git a/core/serialization/blocks.ts b/core/serialization/blocks.ts index 47960258f..b693ff569 100644 --- a/core/serialization/blocks.ts +++ b/core/serialization/blocks.ts @@ -10,6 +10,7 @@ import type {Block} from '../block.js'; import type {BlockSvg} from '../block_svg.js'; import type {Connection} from '../connection.js'; import {MANUALLY_DISABLED} from '../constants.js'; +import {EventType} from '../events/type.js'; import * as eventUtils from '../events/utils.js'; import {inputTypes} from '../inputs/input_types.js'; import {isSerializable} from '../interfaces/i_serializable.js'; @@ -432,7 +433,7 @@ export function appendInternal( if (eventUtils.isEnabled()) { // Block events come after var events, in case they refer to newly created // variables. - eventUtils.fire(new (eventUtils.get(eventUtils.BLOCK_CREATE))(block)); + eventUtils.fire(new (eventUtils.get(EventType.BLOCK_CREATE))(block)); } eventUtils.setGroup(existingGroup); eventUtils.setRecordUndo(prevRecordUndo); @@ -512,9 +513,7 @@ function checkNewVariables( // Fire a VarCreate event for each (if any) new variable created. for (let i = 0; i < newVariables.length; i++) { const thisVariable = newVariables[i]; - eventUtils.fire( - new (eventUtils.get(eventUtils.VAR_CREATE))(thisVariable), - ); + eventUtils.fire(new (eventUtils.get(EventType.VAR_CREATE))(thisVariable)); } } } diff --git a/core/serialization/workspaces.ts b/core/serialization/workspaces.ts index 7206e3715..f201de19e 100644 --- a/core/serialization/workspaces.ts +++ b/core/serialization/workspaces.ts @@ -6,6 +6,7 @@ // Former goog.module ID: Blockly.serialization.workspaces +import {EventType} from '../events/type.js'; import * as eventUtils from '../events/utils.js'; import type {ISerializer} from '../interfaces/i_serializer.js'; import * as registry from '../registry.js'; @@ -86,7 +87,7 @@ export function load( } dom.stopTextWidthCache(); - eventUtils.fire(new (eventUtils.get(eventUtils.FINISHED_LOADING))(workspace)); + eventUtils.fire(new (eventUtils.get(EventType.FINISHED_LOADING))(workspace)); eventUtils.setGroup(existingGroup); eventUtils.setRecordUndo(prevRecordUndo); diff --git a/core/toolbox/toolbox.ts b/core/toolbox/toolbox.ts index 4e0f77207..5d6eee90a 100644 --- a/core/toolbox/toolbox.ts +++ b/core/toolbox/toolbox.ts @@ -20,6 +20,7 @@ import {ComponentManager} from '../component_manager.js'; import * as Css from '../css.js'; import {DeleteArea} from '../delete_area.js'; import '../events/events_toolbox_item_select.js'; +import {EventType} from '../events/type.js'; import * as eventUtils from '../events/utils.js'; import type {IAutoHideable} from '../interfaces/i_autohideable.js'; import type {ICollapsibleToolboxItem} from '../interfaces/i_collapsible_toolbox_item.js'; @@ -962,7 +963,7 @@ export class Toolbox if (oldItem === newItem) { newElement = null; } - const event = new (eventUtils.get(eventUtils.TOOLBOX_ITEM_SELECT))( + const event = new (eventUtils.get(EventType.TOOLBOX_ITEM_SELECT))( oldElement, newElement, this.workspace_.id, diff --git a/core/trashcan.ts b/core/trashcan.ts index 4083a4294..32b56221a 100644 --- a/core/trashcan.ts +++ b/core/trashcan.ts @@ -19,6 +19,7 @@ import {DeleteArea} from './delete_area.js'; import type {Abstract} from './events/events_abstract.js'; import type {BlockDelete} from './events/events_block_delete.js'; import './events/events_trashcan_open.js'; +import {EventType} from './events/type.js'; import * as eventUtils from './events/utils.js'; import type {IAutoHideable} from './interfaces/i_autohideable.js'; import type {IDraggable} from './interfaces/i_draggable.js'; @@ -556,7 +557,7 @@ export class Trashcan * @param trashcanOpen Whether the flyout is opening. */ private fireUiEvent(trashcanOpen: boolean) { - const uiEvent = new (eventUtils.get(eventUtils.TRASHCAN_OPEN))( + const uiEvent = new (eventUtils.get(EventType.TRASHCAN_OPEN))( trashcanOpen, this.workspace.id, ); @@ -603,12 +604,12 @@ export class Trashcan private onDelete(event: Abstract) { if ( this.workspace.options.maxTrashcanContents <= 0 || - event.type !== eventUtils.BLOCK_DELETE + event.type !== EventType.BLOCK_DELETE ) { return; } const deleteEvent = event as BlockDelete; - if (event.type === eventUtils.BLOCK_DELETE && !deleteEvent.wasShadow) { + if (event.type === EventType.BLOCK_DELETE && !deleteEvent.wasShadow) { if (!deleteEvent.oldJson) { throw new Error('Encountered a delete event without proper oldJson'); } diff --git a/core/variable_map.ts b/core/variable_map.ts index bc19b07a5..a67461741 100644 --- a/core/variable_map.ts +++ b/core/variable_map.ts @@ -18,6 +18,7 @@ import './events/events_var_rename.js'; import type {Block} from './block.js'; import * as dialog from './dialog.js'; +import {EventType} from './events/type.js'; import * as eventUtils from './events/utils.js'; import {Msg} from './msg.js'; import {Names} from './names.js'; @@ -119,7 +120,7 @@ export class VariableMap { blocks: Block[], ) { eventUtils.fire( - new (eventUtils.get(eventUtils.VAR_RENAME))(variable, newName), + new (eventUtils.get(EventType.VAR_RENAME))(variable, newName), ); variable.name = newName; for (let i = 0; i < blocks.length; i++) { @@ -158,7 +159,7 @@ export class VariableMap { blocks[i].renameVarById(variable.getId(), conflictVar.getId()); } // Finally delete the original variable, which is now unreferenced. - eventUtils.fire(new (eventUtils.get(eventUtils.VAR_DELETE))(variable)); + eventUtils.fire(new (eventUtils.get(EventType.VAR_DELETE))(variable)); // And remove it from the list. arrayUtils.removeElem(this.variableMap.get(type)!, variable); } @@ -213,7 +214,7 @@ export class VariableMap { this.variableMap.delete(type); this.variableMap.set(type, variables); - eventUtils.fire(new (eventUtils.get(eventUtils.VAR_CREATE))(variable)); + eventUtils.fire(new (eventUtils.get(EventType.VAR_CREATE))(variable)); return variable; } @@ -232,9 +233,7 @@ export class VariableMap { const tempVar = variableList[i]; if (tempVar.getId() === variableId) { variableList.splice(i, 1); - eventUtils.fire( - new (eventUtils.get(eventUtils.VAR_DELETE))(variable), - ); + eventUtils.fire(new (eventUtils.get(EventType.VAR_DELETE))(variable)); if (variableList.length === 0) { this.variableMap.delete(variable.type); } diff --git a/core/workspace_svg.ts b/core/workspace_svg.ts index 6bf5fa5a5..a01bbe07e 100644 --- a/core/workspace_svg.ts +++ b/core/workspace_svg.ts @@ -33,6 +33,7 @@ import { ContextMenuRegistry, } from './contextmenu_registry.js'; import * as dropDownDiv from './dropdowndiv.js'; +import {EventType} from './events/type.js'; import * as eventUtils from './events/utils.js'; import type {FlyoutButton} from './flyout_button.js'; import {Gesture} from './gesture.js'; @@ -558,7 +559,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { this.setVisible(true); } - const event = new (eventUtils.get(eventUtils.THEME_CHANGE))( + const event = new (eventUtils.get(EventType.THEME_CHANGE))( this.getTheme().name, this.id, ); @@ -1181,7 +1182,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { // of negligible changes in viewport top/left. return; } - const event = new (eventUtils.get(eventUtils.VIEWPORT_CHANGE))( + const event = new (eventUtils.get(EventType.VIEWPORT_CHANGE))( top, left, scale, diff --git a/core/xml.ts b/core/xml.ts index 5e344c3db..cecc4dce2 100644 --- a/core/xml.ts +++ b/core/xml.ts @@ -12,6 +12,7 @@ import {RenderedWorkspaceComment} from './comments/rendered_workspace_comment.js import {WorkspaceComment} from './comments/workspace_comment.js'; import type {Connection} from './connection.js'; import {MANUALLY_DISABLED} from './constants.js'; +import {EventType} from './events/type.js'; import * as eventUtils from './events/utils.js'; import type {Field} from './field.js'; import {IconType} from './icons/icon_types.js'; @@ -497,7 +498,7 @@ export function domToWorkspace(xml: Element, workspace: Workspace): string[] { dom.stopTextWidthCache(); } // Re-enable workspace resizing. - eventUtils.fire(new (eventUtils.get(eventUtils.FINISHED_LOADING))(workspace)); + eventUtils.fire(new (eventUtils.get(EventType.FINISHED_LOADING))(workspace)); return newBlockIds; } @@ -666,13 +667,11 @@ export function domToBlockInternal( // Fire a VarCreate event for each (if any) new variable created. for (let i = 0; i < newVariables.length; i++) { const thisVariable = newVariables[i]; - eventUtils.fire( - new (eventUtils.get(eventUtils.VAR_CREATE))(thisVariable), - ); + eventUtils.fire(new (eventUtils.get(EventType.VAR_CREATE))(thisVariable)); } // Block events come after var events, in case they refer to newly created // variables. - eventUtils.fire(new (eventUtils.get(eventUtils.CREATE))(topBlock)); + eventUtils.fire(new (eventUtils.get(EventType.BLOCK_CREATE))(topBlock)); } return topBlock; } diff --git a/core/zoom_controls.ts b/core/zoom_controls.ts index c93d99de4..4f14b73be 100644 --- a/core/zoom_controls.ts +++ b/core/zoom_controls.ts @@ -17,6 +17,7 @@ import './events/events_click.js'; import * as browserEvents from './browser_events.js'; import {ComponentManager} from './component_manager.js'; import * as Css from './css.js'; +import {EventType} from './events/type.js'; import * as eventUtils from './events/utils.js'; import type {IPositionable} from './interfaces/i_positionable.js'; import type {UiMetrics} from './metrics_manager.js'; @@ -467,7 +468,7 @@ export class ZoomControls implements IPositionable { /** Fires a zoom control UI event. */ private fireZoomEvent() { - const uiEvent = new (eventUtils.get(eventUtils.CLICK))( + const uiEvent = new (eventUtils.get(EventType.CLICK))( null, this.workspace.id, 'zoom_controls', diff --git a/tests/mocha/block_test.js b/tests/mocha/block_test.js index 1b685a445..061584401 100644 --- a/tests/mocha/block_test.js +++ b/tests/mocha/block_test.js @@ -5,6 +5,7 @@ */ import {ConnectionType} from '../../build/src/core/connection_type.js'; +import {EventType} from '../../build/src/core/events/type.js'; import * as eventUtils from '../../build/src/core/events/utils.js'; import {EndRowInput} from '../../build/src/core/inputs/end_row_input.js'; import {assert} from '../../node_modules/chai/chai.js'; @@ -1251,7 +1252,7 @@ suite('Blocks', function () { function assertCommentEvent(eventSpy, oldValue, newValue) { const calls = eventSpy.getCalls(); const event = calls[calls.length - 1].args[0]; - assert.equal(event.type, eventUtils.BLOCK_CHANGE); + assert.equal(event.type, EventType.BLOCK_CHANGE); assert.equal( event.element, 'comment', @@ -1271,7 +1272,7 @@ suite('Blocks', function () { function assertNoCommentEvent(eventSpy) { const calls = eventSpy.getCalls(); const event = calls[calls.length - 1].args[0]; - assert.notEqual(event.type, eventUtils.BLOCK_CHANGE); + assert.notEqual(event.type, EventType.BLOCK_CHANGE); } setup(function () { this.eventsFireSpy = sinon.spy(eventUtils.TEST_ONLY, 'fireInternal'); diff --git a/tests/mocha/comment_test.js b/tests/mocha/comment_test.js index 3662a870f..8024fa5e3 100644 --- a/tests/mocha/comment_test.js +++ b/tests/mocha/comment_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import * as eventUtils from '../../build/src/core/events/utils.js'; +import {EventType} from '../../build/src/core/events/type.js'; import {assert} from '../../node_modules/chai/chai.js'; import {assertEventFired} from './test_helpers/events.js'; import { @@ -55,7 +55,7 @@ suite('Comments', function () { assertEventFired( this.eventsFireStub, Blockly.Events.BubbleOpen, - {bubbleType: 'comment', isOpen: true, type: eventUtils.BUBBLE_OPEN}, + {bubbleType: 'comment', isOpen: true, type: EventType.BUBBLE_OPEN}, this.workspace.id, this.block.id, ); @@ -70,7 +70,7 @@ suite('Comments', function () { assertEventFired( this.eventsFireStub, Blockly.Events.BubbleOpen, - {bubbleType: 'comment', isOpen: true, type: eventUtils.BUBBLE_OPEN}, + {bubbleType: 'comment', isOpen: true, type: EventType.BUBBLE_OPEN}, this.workspace.id, this.block.id, ); @@ -86,7 +86,7 @@ suite('Comments', function () { assertEventFired( this.eventsFireStub, Blockly.Events.BubbleOpen, - {bubbleType: 'comment', isOpen: true, type: eventUtils.BUBBLE_OPEN}, + {bubbleType: 'comment', isOpen: true, type: EventType.BUBBLE_OPEN}, this.workspace.id, this.block.id, ); @@ -104,7 +104,7 @@ suite('Comments', function () { assertEventFired( this.eventsFireStub, Blockly.Events.BubbleOpen, - {bubbleType: 'comment', isOpen: true, type: eventUtils.BUBBLE_OPEN}, + {bubbleType: 'comment', isOpen: true, type: EventType.BUBBLE_OPEN}, this.workspace.id, this.block.id, ); diff --git a/tests/mocha/event_block_create_test.js b/tests/mocha/event_block_create_test.js index 94d9c72b3..f59f9435e 100644 --- a/tests/mocha/event_block_create_test.js +++ b/tests/mocha/event_block_create_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import * as eventUtils from '../../build/src/core/events/utils.js'; +import {EventType} from '../../build/src/core/events/type.js'; import {assert} from '../../node_modules/chai/chai.js'; import {defineRowBlock} from './test_helpers/block_definitions.js'; import {assertEventFired} from './test_helpers/events.js'; @@ -48,7 +48,7 @@ suite('Block Create Event', function () { assertEventFired( this.eventsFireStub, Blockly.Events.BlockCreate, - {'recordUndo': false, 'type': eventUtils.BLOCK_CREATE}, + {'recordUndo': false, 'type': EventType.BLOCK_CREATE}, this.workspace.id, 'shadowId', ); diff --git a/tests/mocha/gesture_test.js b/tests/mocha/gesture_test.js index be807a54a..3f53b8894 100644 --- a/tests/mocha/gesture_test.js +++ b/tests/mocha/gesture_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import * as eventUtils from '../../build/src/core/events/utils.js'; +import {EventType} from '../../build/src/core/events/type.js'; import {assert} from '../../node_modules/chai/chai.js'; import {defineBasicBlockWithField} from './test_helpers/block_definitions.js'; import {assertEventFired, assertEventNotFired} from './test_helpers/events.js'; @@ -39,11 +39,11 @@ suite('Gesture', function () { assertEventFired( eventsFireStub, Blockly.Events.Selected, - {newElementId: block.id, type: eventUtils.SELECTED}, + {newElementId: block.id, type: EventType.SELECTED}, fieldWorkspace.id, ); assertEventNotFired(eventsFireStub, Blockly.Events.Click, { - type: eventUtils.CLICK, + type: EventType.CLICK, }); } diff --git a/tests/mocha/jso_deserialization_test.js b/tests/mocha/jso_deserialization_test.js index 432f0a831..dfd3e62b7 100644 --- a/tests/mocha/jso_deserialization_test.js +++ b/tests/mocha/jso_deserialization_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import * as eventUtils from '../../build/src/core/events/utils.js'; +import {EventType} from '../../build/src/core/events/type.js'; import {assert} from '../../node_modules/chai/chai.js'; import {assertEventFired} from './test_helpers/events.js'; import { @@ -66,7 +66,7 @@ suite('JSO Deserialization', function () { assertEventFired( this.eventsFireStub, Blockly.Events.FinishedLoading, - {type: eventUtils.FINISHED_LOADING}, + {type: EventType.FINISHED_LOADING}, this.workspace.id, ); }); @@ -89,7 +89,7 @@ suite('JSO Deserialization', function () { assertEventFired( this.eventsFireStub, Blockly.Events.FinishedLoading, - {'group': 'my group', 'type': eventUtils.FINISHED_LOADING}, + {'group': 'my group', 'type': EventType.FINISHED_LOADING}, this.workspace.id, ); }); @@ -144,7 +144,7 @@ suite('JSO Deserialization', function () { 'varId': 'testId', 'varType': '', 'recordUndo': false, - 'type': eventUtils.VAR_CREATE, + 'type': EventType.VAR_CREATE, }, this.workspace.id, ); @@ -170,7 +170,7 @@ suite('JSO Deserialization', function () { 'varId': 'testId', 'varType': '', 'recordUndo': true, - 'type': eventUtils.VAR_CREATE, + 'type': EventType.VAR_CREATE, }, this.workspace.id, ); @@ -195,7 +195,7 @@ suite('JSO Deserialization', function () { 'varId': 'testId', 'varType': '', 'group': 'my group', - 'type': eventUtils.VAR_CREATE, + 'type': EventType.VAR_CREATE, }, this.workspace.id, ); @@ -260,7 +260,7 @@ suite('JSO Deserialization', function () { 'varName': 'test', 'varId': 'testId', 'varType': '', - 'type': eventUtils.VAR_CREATE, + 'type': EventType.VAR_CREATE, }, this.workspace.id, ); @@ -286,7 +286,7 @@ suite('JSO Deserialization', function () { assertEventFired( this.eventsFireStub, Blockly.Events.BlockCreate, - {'recordUndo': false, 'type': eventUtils.BLOCK_CREATE}, + {'recordUndo': false, 'type': EventType.BLOCK_CREATE}, this.workspace.id, 'testId', ); @@ -311,7 +311,7 @@ suite('JSO Deserialization', function () { assertEventFired( this.eventsFireStub, Blockly.Events.BlockCreate, - {'recordUndo': true, 'type': eventUtils.BLOCK_CREATE}, + {'recordUndo': true, 'type': EventType.BLOCK_CREATE}, this.workspace.id, 'testId', ); @@ -335,7 +335,7 @@ suite('JSO Deserialization', function () { assertEventFired( this.eventsFireStub, Blockly.Events.BlockCreate, - {'group': 'my group', 'type': eventUtils.BLOCK_CREATE}, + {'group': 'my group', 'type': EventType.BLOCK_CREATE}, this.workspace.id, 'testId', ); @@ -397,7 +397,7 @@ suite('JSO Deserialization', function () { assertEventFired( this.eventsFireStub, Blockly.Events.BlockCreate, - {type: eventUtils.BLOCK_CREATE}, + {type: EventType.BLOCK_CREATE}, this.workspace.id, 'id1', ); @@ -435,7 +435,7 @@ suite('JSO Deserialization', function () { assertEventFired( this.eventsFireStub, Blockly.Events.BlockCreate, - {'recordUndo': true, 'type': eventUtils.BLOCK_CREATE}, + {'recordUndo': true, 'type': EventType.BLOCK_CREATE}, this.workspace.id, 'testId', ); @@ -453,7 +453,7 @@ suite('JSO Deserialization', function () { assertEventFired( this.eventsFireStub, Blockly.Events.BlockCreate, - {'group': 'my group', 'type': eventUtils.BLOCK_CREATE}, + {'group': 'my group', 'type': EventType.BLOCK_CREATE}, this.workspace.id, 'testId', ); diff --git a/tests/mocha/theme_test.js b/tests/mocha/theme_test.js index e94bc5e50..1f425dca6 100644 --- a/tests/mocha/theme_test.js +++ b/tests/mocha/theme_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import * as eventUtils from '../../build/src/core/events/utils.js'; +import {EventType} from '../../build/src/core/events/type.js'; import {assert} from '../../node_modules/chai/chai.js'; import {assertEventFired} from './test_helpers/events.js'; import { @@ -153,7 +153,7 @@ suite('Theme', function () { assertEventFired( this.eventsFireStub, Blockly.Events.ThemeChange, - {themeName: 'themeName', type: eventUtils.THEME_CHANGE}, + {themeName: 'themeName', type: EventType.THEME_CHANGE}, workspace.id, ); } finally { diff --git a/tests/mocha/trashcan_test.js b/tests/mocha/trashcan_test.js index 7ba624094..5486326f1 100644 --- a/tests/mocha/trashcan_test.js +++ b/tests/mocha/trashcan_test.js @@ -4,6 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ +import {EventType} from '../../build/src/core/events/type.js'; import * as eventUtils from '../../build/src/core/events/utils.js'; import {assert} from '../../node_modules/chai/chai.js'; import { @@ -91,12 +92,12 @@ suite('Trashcan', function () { simulateClick(this.trashcan.svgGroup); assertEventNotFired(this.eventsFireStub, Blockly.Events.TrashcanOpen, { - type: eventUtils.CLICK, + type: EventType.CLICK, }); assertEventFired( this.eventsFireStub, Blockly.Events.Click, - {targetType: 'workspace', type: eventUtils.CLICK}, + {targetType: 'workspace', type: EventType.CLICK}, this.workspace.id, undefined, ); @@ -114,11 +115,11 @@ suite('Trashcan', function () { assertEventFired( this.eventsFireStub, Blockly.Events.TrashcanOpen, - {isOpen: true, type: eventUtils.TRASHCAN_OPEN}, + {isOpen: true, type: EventType.TRASHCAN_OPEN}, this.workspace.id, ); assertEventNotFired(this.eventsFireStub, Blockly.Events.Click, { - type: eventUtils.TRASHCAN_OPEN, + type: EventType.TRASHCAN_OPEN, }); }); test('Click outside trashcan - fires trashcanClose', function () { @@ -133,13 +134,13 @@ suite('Trashcan', function () { assertEventFired( this.eventsFireStub, Blockly.Events.TrashcanOpen, - {isOpen: false, type: eventUtils.TRASHCAN_OPEN}, + {isOpen: false, type: EventType.TRASHCAN_OPEN}, this.workspace.id, ); assertEventFired( this.eventsFireStub, Blockly.Events.Click, - {targetType: 'workspace', type: eventUtils.CLICK}, + {targetType: 'workspace', type: EventType.CLICK}, this.workspace.id, undefined, ); diff --git a/tests/mocha/workspace_svg_test.js b/tests/mocha/workspace_svg_test.js index 7439ccc5d..d5c80e2f3 100644 --- a/tests/mocha/workspace_svg_test.js +++ b/tests/mocha/workspace_svg_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import * as eventUtils from '../../build/src/core/events/utils.js'; +import {EventType} from '../../build/src/core/events/type.js'; import {assert} from '../../node_modules/chai/chai.js'; import {defineStackBlock} from './test_helpers/block_definitions.js'; import { @@ -187,7 +187,7 @@ suite('WorkspaceSvg', function () { oldScale: 1, viewTop: metrics.viewTop, viewLeft: metrics.viewLeft, - type: eventUtils.VIEWPORT_CHANGE, + type: EventType.VIEWPORT_CHANGE, }; assertSpyFiredViewportEvent( changeListenerSpy, @@ -350,7 +350,7 @@ suite('WorkspaceSvg', function () { assertEventNotFired( this.changeListenerSpy, Blockly.Events.ViewportChange, - {type: eventUtils.VIEWPORT_CHANGE}, + {type: EventType.VIEWPORT_CHANGE}, ); }); test("domToWorkspace at 0,0 that doesn't trigger scroll", function () { @@ -377,7 +377,7 @@ suite('WorkspaceSvg', function () { assertEventNotFired( this.changeListenerSpy, Blockly.Events.ViewportChange, - {type: eventUtils.VIEWPORT_CHANGE}, + {type: EventType.VIEWPORT_CHANGE}, ); }); test.skip('domToWorkspace multiple blocks triggers one viewport event', function () { diff --git a/tests/mocha/zoom_controls_test.js b/tests/mocha/zoom_controls_test.js index 8751420c8..dedc36b75 100644 --- a/tests/mocha/zoom_controls_test.js +++ b/tests/mocha/zoom_controls_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import * as eventUtils from '../../build/src/core/events/utils.js'; +import {EventType} from '../../build/src/core/events/type.js'; import {assert} from '../../node_modules/chai/chai.js'; import {assertEventFired, assertEventNotFired} from './test_helpers/events.js'; import { @@ -35,13 +35,13 @@ suite('Zoom Controls', function () { assertEventFired( this.eventsFireStub, Blockly.Events.Click, - {targetType: 'zoom_controls', type: eventUtils.CLICK}, + {targetType: 'zoom_controls', type: EventType.CLICK}, this.workspace.id, undefined, ); assertEventNotFired(this.eventsFireStub, Blockly.Events.Click, { targetType: 'workspace', - type: eventUtils.CLICK, + type: EventType.CLICK, }); assert.closeTo(this.workspace.getScale(), 1.2, 0.05); }); @@ -51,13 +51,13 @@ suite('Zoom Controls', function () { assertEventFired( this.eventsFireStub, Blockly.Events.Click, - {targetType: 'zoom_controls', type: eventUtils.CLICK}, + {targetType: 'zoom_controls', type: EventType.CLICK}, this.workspace.id, undefined, ); assertEventNotFired(this.eventsFireStub, Blockly.Events.Click, { targetType: 'workspace', - type: eventUtils.CLICK, + type: EventType.CLICK, }); assert.closeTo(this.workspace.getScale(), 0.8, 0.05); }); @@ -67,13 +67,13 @@ suite('Zoom Controls', function () { assertEventFired( this.eventsFireStub, Blockly.Events.Click, - {targetType: 'zoom_controls', type: eventUtils.CLICK}, + {targetType: 'zoom_controls', type: EventType.CLICK}, this.workspace.id, undefined, ); assertEventNotFired(this.eventsFireStub, Blockly.Events.Click, { targetType: 'workspace', - type: eventUtils.CLICK, + type: EventType.CLICK, }); assert.equal(this.workspace.getScale(), 1); }); From bde216d1205a6d3523b74525a93ef4c2c35da925 Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Tue, 20 Aug 2024 08:39:37 +0100 Subject: [PATCH 30/90] refactor(events): Don't filter events before undo (#8537) Use of the filter function in Workspace.prototype.undo has caused problems with repeated undo/redo (see issue #7026), the originally-chosen fix for which was the addition (in PR #7069) of code to fireNow to post-filter the .undoStack_ and .redoStack_ of any workspace that had just been involved in dispatching events. This apparently resolved the issue but added considerable additional complexity and made it difficult to reason about how events are processed for undo/redo. Instead, since this filtering typically does nothing (at least nothing desirable), simply don't re-filter events on the undo stack before replaying them. --- core/events/utils.ts | 79 +++++++++++++++++++++----------------------- core/workspace.ts | 3 +- 2 files changed, 38 insertions(+), 44 deletions(-) diff --git a/core/events/utils.ts b/core/events/utils.ts index b320a7a8f..d0aad5f53 100644 --- a/core/events/utils.ts +++ b/core/events/utils.ts @@ -105,7 +105,7 @@ function fireInternal(event: Abstract) { FIRE_QUEUE.push(event); } -/** Fire all queued events. */ +/** Dispatch all queued events. */ function fireNow() { const queue = filter(FIRE_QUEUE, true); FIRE_QUEUE.length = 0; @@ -118,50 +118,45 @@ function fireNow() { eventWorkspace.fireChangeListener(event); } } - - // Post-filter the undo stack to squash and remove any events that result in - // a null event - - // 1. Determine which workspaces will need to have their undo stacks validated - const workspaceIds = new Set(queue.map((e) => e.workspaceId)); - for (const workspaceId of workspaceIds) { - // Only process valid workspaces - if (!workspaceId) { - continue; - } - const eventWorkspace = common.getWorkspaceById(workspaceId); - if (!eventWorkspace) { - continue; - } - - // Find the last contiguous group of events on the stack - const undoStack = eventWorkspace.getUndoStack(); - let i; - let group: string | undefined = undefined; - for (i = undoStack.length; i > 0; i--) { - const event = undoStack[i - 1]; - if (event.group === '') { - break; - } else if (group === undefined) { - group = event.group; - } else if (event.group !== group) { - break; - } - } - if (!group || i == undoStack.length - 1) { - // Need a group of two or more events on the stack. Nothing to do here. - continue; - } - - // Extract the event group, filter, and add back to the undo stack - let events = undoStack.splice(i, undoStack.length - i); - events = filter(events, true); - undoStack.push(...events); - } } /** - * Filter the queued events and merge duplicates. + * Filter the queued events by merging duplicates, removing null + * events and reording BlockChange events. + * + * History of this function: + * + * This function was originally added in commit cf257ea5 with the + * intention of dramatically reduing the total number of dispatched + * events. Initialy it affected only BlockMove events but others were + * added over time. + * + * Code was added to reorder BlockChange events added in commit + * 5578458, for uncertain reasons but most probably as part of an + * only-partially-successful attemp to fix problems with event + * ordering during block mutations. This code should probably have + * been added to the top of the function, before merging and + * null-removal, but was added at the bottom for now-forgotten + * reasons. See these bug investigations for a fuller discussion of + * the underlying issue and some of the failures that arose because of + * this incomplete/incorrect fix: + * + * https://github.com/google/blockly/issues/8225#issuecomment-2195751783 + * https://github.com/google/blockly/issues/2037#issuecomment-2209696351 + * + * Later, in PR #1205 the original O(n^2) implementation was replaced + * by a linear-time implementation, though addiitonal fixes were made + * subsequently. + * + * This function was previously called from Workspace.prototype.undo, + * but this was the cause of issue #7026, the originally-chosen fix + * for which was the addition (in PR #7069) of code to fireNow to + * post-filter the .undoStack_ and .redoStack_ of any workspace that + * had just been involved in dispatching events. This apparently + * resolved the issue but added considerable additional complexity and + * made it difficlut to reason about how events are processed for + * undo/redo, so both the call from undo and the post-processing code + * was later removed. * * @param queueIn Array of events. * @param forward True if forward (redo), false if backward (undo). diff --git a/core/workspace.ts b/core/workspace.ts index bf734243f..bc09d36fb 100644 --- a/core/workspace.ts +++ b/core/workspace.ts @@ -634,7 +634,7 @@ export class Workspace implements IASTNodeLocation { if (!inputEvent) { return; } - let events = [inputEvent]; + const events = [inputEvent]; // Do another undo/redo if the next one is of the same group. while ( inputStack.length && @@ -650,7 +650,6 @@ export class Workspace implements IASTNodeLocation { const event = events[i]; outputStack.push(event); } - events = eventUtils.filter(events, redo); eventUtils.setRecordUndo(false); try { for (let i = 0; i < events.length; i++) { From 032b5ed9eaa87f610beb34f977992aa1c0c8ff0c Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Tue, 20 Aug 2024 19:50:29 +0100 Subject: [PATCH 31/90] refactor(events): Introduce and use event type predicates (#8538) * refactor(events): Introduce type predicates for event classes Introduce predicates for testing Abstract event subclasses based on their .type properties. These are useful because there are places where it is not possible to use instanceof tests for type narrowing due to load ordering issues that would be caused by the need to import (rather than just import type) the class constructors in question. * refactor(events): Use event type predicates Simplify several sections of code by using type predicates for type narrowing and thereby avoiding the need for explicit casts. * chore(events): Fix copyright date of recently-added files * chore: Remove unused import --- core/bump_objects.ts | 11 +-- core/events/predicates.ts | 172 +++++++++++++++++++++++++++++++++++++ core/events/type.ts | 2 +- core/events/utils.ts | 60 ++++++------- core/icons/mutator_icon.ts | 6 +- core/procedures.ts | 20 +++-- core/trashcan.ts | 34 +++----- 7 files changed, 231 insertions(+), 74 deletions(-) create mode 100644 core/events/predicates.ts diff --git a/core/bump_objects.ts b/core/bump_objects.ts index 7fe1e3851..2aae257dd 100644 --- a/core/bump_objects.ts +++ b/core/bump_objects.ts @@ -13,7 +13,7 @@ import type {BlockMove} from './events/events_block_move.js'; import type {CommentCreate} from './events/events_comment_create.js'; import type {CommentMove} from './events/events_comment_move.js'; import type {CommentResize} from './events/events_comment_resize.js'; -import type {ViewportChange} from './events/events_viewport.js'; +import {isViewportChange} from './events/predicates.js'; import {BUMP_EVENTS, EventType} from './events/type.js'; import * as eventUtils from './events/utils.js'; import type {IBoundedElement} from './interfaces/i_bounded_element.js'; @@ -128,13 +128,8 @@ export function bumpIntoBoundsHandler( ); } eventUtils.setGroup(existingGroup); - } else if (e.type === EventType.VIEWPORT_CHANGE) { - const viewportEvent = e as ViewportChange; - if ( - viewportEvent.scale && - viewportEvent.oldScale && - viewportEvent.scale > viewportEvent.oldScale - ) { + } else if (isViewportChange(e)) { + if (e.scale && e.oldScale && e.scale > e.oldScale) { bumpTopObjectsIntoBounds(workspace); } } diff --git a/core/events/predicates.ts b/core/events/predicates.ts new file mode 100644 index 000000000..79d8ca284 --- /dev/null +++ b/core/events/predicates.ts @@ -0,0 +1,172 @@ +/** + * @license + * Copyright 2024 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @file Predicates for testing Abstract event subclasses based on + * their .type properties. These are useful because there are places + * where it is not possible to use instanceof tests + * for type narrowing due to load ordering issues that would be caused + * by the need to import (rather than just import type) the class + * constructors in question. + */ + +import type {Abstract} from './events_abstract.js'; +import type {BlockChange} from './events_block_change.js'; +import type {BlockCreate} from './events_block_create.js'; +import type {BlockDelete} from './events_block_delete.js'; +import type {BlockDrag} from './events_block_drag.js'; +import type {BlockFieldIntermediateChange} from './events_block_field_intermediate_change.js'; +import type {BlockMove} from './events_block_move.js'; +import type {BubbleOpen} from './events_bubble_open.js'; +import type {Click} from './events_click.js'; +import type {CommentChange} from './events_comment_change.js'; +import type {CommentCollapse} from './events_comment_collapse.js'; +import type {CommentCreate} from './events_comment_create.js'; +import type {CommentDelete} from './events_comment_delete.js'; +import type {CommentDrag} from './events_comment_drag.js'; +import type {CommentMove} from './events_comment_move.js'; +import type {CommentResize} from './events_comment_resize.js'; +import type {MarkerMove} from './events_marker_move.js'; +import type {Selected} from './events_selected.js'; +import type {ThemeChange} from './events_theme_change.js'; +import type {ToolboxItemSelect} from './events_toolbox_item_select.js'; +import type {TrashcanOpen} from './events_trashcan_open.js'; +import type {VarCreate} from './events_var_create.js'; +import type {VarDelete} from './events_var_delete.js'; +import type {VarRename} from './events_var_rename.js'; +import type {ViewportChange} from './events_viewport.js'; +import type {FinishedLoading} from './workspace_events.js'; + +import {EventType} from './type.js'; + +/** @returns true iff event.type is EventType.BLOCK_CREATE */ +export function isBlockCreate(event: Abstract): event is BlockCreate { + return event.type === EventType.BLOCK_CREATE; +} + +/** @returns true iff event.type is EventType.BLOCK_DELETE */ +export function isBlockDelete(event: Abstract): event is BlockDelete { + return event.type === EventType.BLOCK_DELETE; +} + +/** @returns true iff event.type is EventType.BLOCK_CHANGE */ +export function isBlockChange(event: Abstract): event is BlockChange { + return event.type === EventType.BLOCK_CHANGE; +} + +/** @returns true iff event.type is EventType.BLOCK_FIELD_INTERMEDIATE_CHANGE */ +export function isBlockFieldIntermediateChange( + event: Abstract, +): event is BlockFieldIntermediateChange { + return event.type === EventType.BLOCK_FIELD_INTERMEDIATE_CHANGE; +} + +/** @returns true iff event.type is EventType.BLOCK_MOVE */ +export function isBlockMove(event: Abstract): event is BlockMove { + return event.type === EventType.BLOCK_MOVE; +} + +/** @returns true iff event.type is EventType.VAR_CREATE */ +export function isVarCreate(event: Abstract): event is VarCreate { + return event.type === EventType.VAR_CREATE; +} + +/** @returns true iff event.type is EventType.VAR_DELETE */ +export function isVarDelete(event: Abstract): event is VarDelete { + return event.type === EventType.VAR_DELETE; +} + +/** @returns true iff event.type is EventType.VAR_RENAME */ +export function isVarRename(event: Abstract): event is VarRename { + return event.type === EventType.VAR_RENAME; +} + +/** @returns true iff event.type is EventType.BLOCK_DRAG */ +export function isBlockDrag(event: Abstract): event is BlockDrag { + return event.type === EventType.BLOCK_DRAG; +} + +/** @returns true iff event.type is EventType.SELECTED */ +export function isSelected(event: Abstract): event is Selected { + return event.type === EventType.SELECTED; +} + +/** @returns true iff event.type is EventType.CLICK */ +export function isClick(event: Abstract): event is Click { + return event.type === EventType.CLICK; +} + +/** @returns true iff event.type is EventType.MARKER_MOVE */ +export function isMarkerMove(event: Abstract): event is MarkerMove { + return event.type === EventType.MARKER_MOVE; +} + +/** @returns true iff event.type is EventType.BUBBLE_OPEN */ +export function isBubbleOpen(event: Abstract): event is BubbleOpen { + return event.type === EventType.BUBBLE_OPEN; +} + +/** @returns true iff event.type is EventType.TRASHCAN_OPEN */ +export function isTrashcanOpen(event: Abstract): event is TrashcanOpen { + return event.type === EventType.TRASHCAN_OPEN; +} + +/** @returns true iff event.type is EventType.TOOLBOX_ITEM_SELECT */ +export function isToolboxItemSelect( + event: Abstract, +): event is ToolboxItemSelect { + return event.type === EventType.TOOLBOX_ITEM_SELECT; +} + +/** @returns true iff event.type is EventType.THEME_CHANGE */ +export function isThemeChange(event: Abstract): event is ThemeChange { + return event.type === EventType.THEME_CHANGE; +} + +/** @returns true iff event.type is EventType.VIEWPORT_CHANGE */ +export function isViewportChange(event: Abstract): event is ViewportChange { + return event.type === EventType.VIEWPORT_CHANGE; +} + +/** @returns true iff event.type is EventType.COMMENT_CREATE */ +export function isCommentCreate(event: Abstract): event is CommentCreate { + return event.type === EventType.COMMENT_CREATE; +} + +/** @returns true iff event.type is EventType.COMMENT_DELETE */ +export function isCommentDelete(event: Abstract): event is CommentDelete { + return event.type === EventType.COMMENT_DELETE; +} + +/** @returns true iff event.type is EventType.COMMENT_CHANGE */ +export function isCommentChange(event: Abstract): event is CommentChange { + return event.type === EventType.COMMENT_CHANGE; +} + +/** @returns true iff event.type is EventType.COMMENT_MOVE */ +export function isCommentMove(event: Abstract): event is CommentMove { + return event.type === EventType.COMMENT_MOVE; +} + +/** @returns true iff event.type is EventType.COMMENT_RESIZE */ +export function isCommentResize(event: Abstract): event is CommentResize { + return event.type === EventType.COMMENT_RESIZE; +} + +/** @returns true iff event.type is EventType.COMMENT_DRAG */ +export function isCommentDrag(event: Abstract): event is CommentDrag { + return event.type === EventType.COMMENT_DRAG; +} + +/** @returns true iff event.type is EventType.COMMENT_COLLAPSE */ +export function isCommentCollapse(event: Abstract): event is CommentCollapse { + return event.type === EventType.COMMENT_COLLAPSE; +} + +/** @returns true iff event.type is EventType.FINISHED_LOADING */ +export function isFinishedLoading(event: Abstract): event is FinishedLoading { + return event.type === EventType.FINISHED_LOADING; +} diff --git a/core/events/type.ts b/core/events/type.ts index 71060efbb..db9ad6c96 100644 --- a/core/events/type.ts +++ b/core/events/type.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright 2021 Google LLC + * Copyright 2024 Google LLC * SPDX-License-Identifier: Apache-2.0 */ diff --git a/core/events/utils.ts b/core/events/utils.ts index d0aad5f53..63217168f 100644 --- a/core/events/utils.ts +++ b/core/events/utils.ts @@ -13,13 +13,19 @@ import * as idGenerator from '../utils/idgenerator.js'; import type {Workspace} from '../workspace.js'; import type {WorkspaceSvg} from '../workspace_svg.js'; import type {Abstract} from './events_abstract.js'; -import type {BlockChange} from './events_block_change.js'; import type {BlockCreate} from './events_block_create.js'; import type {BlockMove} from './events_block_move.js'; import type {CommentCreate} from './events_comment_create.js'; import type {CommentMove} from './events_comment_move.js'; import type {CommentResize} from './events_comment_resize.js'; -import type {ViewportChange} from './events_viewport.js'; +import { + isBlockChange, + isBlockCreate, + isBlockMove, + isBubbleOpen, + isClick, + isViewportChange, +} from './predicates.js'; import {EventType} from './type.js'; /** Group ID for new events. Grouped events are indivisible. */ @@ -188,46 +194,35 @@ export function filter(queueIn: Abstract[], forward: boolean): Abstract[] { // move events. hash[key] = {event, index: i}; mergedQueue.push(event); - } else if ( - event.type === EventType.BLOCK_MOVE && - lastEntry.index === i - 1 - ) { - const moveEvent = event as BlockMove; + } else if (isBlockMove(event) && lastEntry.index === i - 1) { // Merge move events. - lastEvent.newParentId = moveEvent.newParentId; - lastEvent.newInputName = moveEvent.newInputName; - lastEvent.newCoordinate = moveEvent.newCoordinate; - if (moveEvent.reason) { + lastEvent.newParentId = event.newParentId; + lastEvent.newInputName = event.newInputName; + lastEvent.newCoordinate = event.newCoordinate; + if (event.reason) { if (lastEvent.reason) { // Concatenate reasons without duplicates. - const reasonSet = new Set( - moveEvent.reason.concat(lastEvent.reason), - ); + const reasonSet = new Set(event.reason.concat(lastEvent.reason)); lastEvent.reason = Array.from(reasonSet); } else { - lastEvent.reason = moveEvent.reason; + lastEvent.reason = event.reason; } } lastEntry.index = i; } else if ( - event.type === EventType.BLOCK_CHANGE && - (event as BlockChange).element === lastEvent.element && - (event as BlockChange).name === lastEvent.name + isBlockChange(event) && + event.element === lastEvent.element && + event.name === lastEvent.name ) { - const changeEvent = event as BlockChange; // Merge change events. - lastEvent.newValue = changeEvent.newValue; - } else if (event.type === EventType.VIEWPORT_CHANGE) { - const viewportEvent = event as ViewportChange; + lastEvent.newValue = event.newValue; + } else if (isViewportChange(event)) { // Merge viewport change events. - lastEvent.viewTop = viewportEvent.viewTop; - lastEvent.viewLeft = viewportEvent.viewLeft; - lastEvent.scale = viewportEvent.scale; - lastEvent.oldScale = viewportEvent.oldScale; - } else if ( - event.type === EventType.CLICK && - lastEvent.type === EventType.BUBBLE_OPEN - ) { + lastEvent.viewTop = event.viewTop; + lastEvent.viewLeft = event.viewLeft; + lastEvent.scale = event.scale; + lastEvent.oldScale = event.oldScale; + } else if (isClick(event) && isBubbleOpen(lastEvent)) { // Drop click events caused by opening/closing bubbles. } else { // Collision: newer events should merge into this event to maintain @@ -381,10 +376,7 @@ export function get( * @param event Custom data for event. */ export function disableOrphans(event: Abstract) { - if ( - event.type === EventType.BLOCK_MOVE || - event.type === EventType.BLOCK_CREATE - ) { + if (isBlockMove(event) || isBlockCreate(event)) { const blockEvent = event as BlockMove | BlockCreate; if (!blockEvent.workspaceId) { return; diff --git a/core/icons/mutator_icon.ts b/core/icons/mutator_icon.ts index 5c137917a..d02c7e187 100644 --- a/core/icons/mutator_icon.ts +++ b/core/icons/mutator_icon.ts @@ -11,6 +11,7 @@ import type {BlocklyOptions} from '../blockly_options.js'; import {MiniWorkspaceBubble} from '../bubbles/mini_workspace_bubble.js'; import type {Abstract} from '../events/events_abstract.js'; import {BlockChange} from '../events/events_block_change.js'; +import {isBlockChange, isBlockCreate} from '../events/predicates.js'; import {EventType} from '../events/type.js'; import * as eventUtils from '../events/utils.js'; import type {IHasBubble} from '../interfaces/i_has_bubble.js'; @@ -308,9 +309,8 @@ export class MutatorIcon extends Icon implements IHasBubble { static isIgnorableMutatorEvent(e: Abstract) { return ( e.isUiEvent || - e.type === EventType.BLOCK_CREATE || - (e.type === EventType.BLOCK_CHANGE && - (e as BlockChange).element === 'disabled') + isBlockCreate(e) || + (isBlockChange(e) && e.element === 'disabled') ); } diff --git a/core/procedures.ts b/core/procedures.ts index bad4ef05a..a16b0fce4 100644 --- a/core/procedures.ts +++ b/core/procedures.ts @@ -15,6 +15,13 @@ import {Blocks} from './blocks.js'; import * as common from './common.js'; import type {Abstract} from './events/events_abstract.js'; import type {BubbleOpen} from './events/events_bubble_open.js'; +import { + isBlockChange, + isBlockCreate, + isBlockDelete, + isBlockFieldIntermediateChange, + isBubbleOpen, +} from './events/predicates.js'; import {EventType} from './events/type.js'; import * as eventUtils from './events/utils.js'; import {Field, UnattachedFieldError} from './field.js'; @@ -355,9 +362,8 @@ function updateMutatorFlyout(workspace: WorkspaceSvg) { * @internal */ export function mutatorOpenListener(e: Abstract) { - if (e.type !== EventType.BUBBLE_OPEN) { - return; - } + if (!isBubbleOpen(e)) return; + const bubbleEvent = e as BubbleOpen; if ( !(bubbleEvent.bubbleType === 'mutator' && bubbleEvent.isOpen) || @@ -387,10 +393,10 @@ export function mutatorOpenListener(e: Abstract) { */ function mutatorChangeListener(e: Abstract) { if ( - e.type !== EventType.BLOCK_CREATE && - e.type !== EventType.BLOCK_DELETE && - e.type !== EventType.BLOCK_CHANGE && - e.type !== EventType.BLOCK_FIELD_INTERMEDIATE_CHANGE + !isBlockCreate(e) && + !isBlockDelete(e) && + !isBlockChange(e) && + !isBlockFieldIntermediateChange(e) ) { return; } diff --git a/core/trashcan.ts b/core/trashcan.ts index 32b56221a..d30c4a4e2 100644 --- a/core/trashcan.ts +++ b/core/trashcan.ts @@ -17,8 +17,8 @@ import * as browserEvents from './browser_events.js'; import {ComponentManager} from './component_manager.js'; import {DeleteArea} from './delete_area.js'; import type {Abstract} from './events/events_abstract.js'; -import type {BlockDelete} from './events/events_block_delete.js'; import './events/events_trashcan_open.js'; +import {isBlockDelete} from './events/predicates.js'; import {EventType} from './events/type.js'; import * as eventUtils from './events/utils.js'; import type {IAutoHideable} from './interfaces/i_autohideable.js'; @@ -604,30 +604,22 @@ export class Trashcan private onDelete(event: Abstract) { if ( this.workspace.options.maxTrashcanContents <= 0 || - event.type !== EventType.BLOCK_DELETE + !isBlockDelete(event) || + event.wasShadow ) { return; } - const deleteEvent = event as BlockDelete; - if (event.type === EventType.BLOCK_DELETE && !deleteEvent.wasShadow) { - if (!deleteEvent.oldJson) { - throw new Error('Encountered a delete event without proper oldJson'); - } - const cleanedJson = JSON.stringify( - this.cleanBlockJson(deleteEvent.oldJson), - ); - if (this.contents.includes(cleanedJson)) { - return; - } - this.contents.unshift(cleanedJson); - while ( - this.contents.length > this.workspace.options.maxTrashcanContents - ) { - this.contents.pop(); - } - - this.setMinOpenness(HAS_BLOCKS_LID_ANGLE); + if (!event.oldJson) { + throw new Error('Encountered a delete event without proper oldJson'); } + const cleanedJson = JSON.stringify(this.cleanBlockJson(event.oldJson)); + if (this.contents.includes(cleanedJson)) return; + this.contents.unshift(cleanedJson); + while (this.contents.length > this.workspace.options.maxTrashcanContents) { + this.contents.pop(); + } + + this.setMinOpenness(HAS_BLOCKS_LID_ANGLE); } /** From 9445adf8feb1f8431436c9ec61414df201b772a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Aug 2024 11:27:18 +0100 Subject: [PATCH 32/90] chore(deps): bump mocha from 10.6.0 to 10.7.3 (#8481) Bumps [mocha](https://github.com/mochajs/mocha) from 10.6.0 to 10.7.3. - [Release notes](https://github.com/mochajs/mocha/releases) - [Changelog](https://github.com/mochajs/mocha/blob/main/CHANGELOG.md) - [Commits](https://github.com/mochajs/mocha/compare/v10.6.0...v10.7.3) --- updated-dependencies: - dependency-name: mocha dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index fa88a3f6f..7097ad6d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6715,9 +6715,9 @@ "dev": true }, "node_modules/mocha": { - "version": "10.6.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.6.0.tgz", - "integrity": "sha512-hxjt4+EEB0SA0ZDygSS015t65lJw/I2yRCS3Ae+SJ5FrbzrXgfYwJr96f0OvIXdj7h4lv/vLCrH3rkiuizFSvw==", + "version": "10.7.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.7.3.tgz", + "integrity": "sha512-uQWxAu44wwiACGqjbPYmjo7Lg8sFrS3dQe7PP2FQI+woptP4vZXSMcfMyFL/e1yFEeEpV4RtyTpZROOKmxis+A==", "dev": true, "dependencies": { "ansi-colors": "^4.1.3", From 3a3e83fe44f12b9b617870da0385dcb3d7307bee Mon Sep 17 00:00:00 2001 From: Ben Henning Date: Wed, 21 Aug 2024 17:41:38 +0000 Subject: [PATCH 33/90] Fix workspace clean up not considering immovables. At a high-level, this change ensures that cleaning up a workspace doesn't move blocks in a way that overlaps with immovable blocks. It also adds missing testing coverage for both Rect (used for bounding box calculations during workspace cleanup) and WorkspaceSvg (for verifying the updated clean up functionality). This also renames the clean up function to be 'tidyUp' since that better suits what's happening (as opposed to other clean-up routines which are actually deinitializing objects). --- core/contextmenu_items.ts | 2 +- core/utils/rect.ts | 59 +- core/workspace_svg.ts | 49 +- .../workspacefactory/wfactory_controller.js | 6 +- tests/mocha/contextmenu_items_test.js | 6 +- tests/mocha/index.html | 1 + tests/mocha/rect_test.js | 968 ++++++++++++++++++ tests/mocha/workspace_svg_test.js | 428 +++++++- 8 files changed, 1493 insertions(+), 26 deletions(-) create mode 100644 tests/mocha/rect_test.js diff --git a/core/contextmenu_items.ts b/core/contextmenu_items.ts index 254906ce7..ec98d7e83 100644 --- a/core/contextmenu_items.ts +++ b/core/contextmenu_items.ts @@ -91,7 +91,7 @@ export function registerCleanup() { return 'hidden'; }, callback(scope: Scope) { - scope.workspace!.cleanUp(); + scope.workspace!.tidyUp(); }, scopeType: ContextMenuRegistry.ScopeType.WORKSPACE, id: 'cleanWorkspace', diff --git a/core/utils/rect.ts b/core/utils/rect.ts index 817462b69..adf0d2b94 100644 --- a/core/utils/rect.ts +++ b/core/utils/rect.ts @@ -13,6 +13,8 @@ */ // Former goog.module ID: Blockly.utils.Rect +import {Coordinate} from './coordinate.js'; + /** * Class for representing rectangular regions. */ @@ -30,10 +32,21 @@ export class Rect { public right: number, ) {} + /** + * Creates a new copy of this rectangle. + * + * @returns A copy of this Rect. + */ + clone(): Rect { + return new Rect(this.top, this.bottom, this.left, this.right); + } + + /** Returns the height of this rectangle. */ getHeight(): number { return this.bottom - this.top; } + /** Returns the width of this rectangle. */ getWidth(): number { return this.right - this.left; } @@ -59,11 +72,45 @@ export class Rect { * @returns Whether this rectangle intersects the provided rectangle. */ intersects(other: Rect): boolean { - return !( - this.left > other.right || - this.right < other.left || - this.top > other.bottom || - this.bottom < other.top - ); + // The following logic can be derived and then simplified from a longer form symmetrical check + // of verifying each rectangle's borders with the other rectangle by checking if either end of + // the border's line segment is contained within the other rectangle. The simplified version + // used here can be logically interpreted as ensuring that each line segment of 'this' rectangle + // is not outside the bounds of the 'other' rectangle (proving there's an intersection). + return (this.left <= other.right) + && (this.right >= other.left) + && (this.bottom >= other.top) + && (this.top <= other.bottom); + } + + /** + * Compares bounding rectangles for equality. + * + * @param a A Rect. + * @param b A Rect. + * @returns True iff the bounding rectangles are equal, or if both are null. + */ + static equals(a?: Rect | null, b?: Rect | null): boolean { + if (a === b) { + return true; + } + if (!a || !b) { + return false; + } + return a.top === b.top && a.bottom === b.bottom && a.left === b.left && a.right === b.right; + } + + /** + * Creates a new Rect using a position and supplied dimensions. + * + * @param position The upper left coordinate of the new rectangle. + * @param width The width of the rectangle, in pixels. + * @param height The height of the rectangle, in pixels. + * @returns A newly created Rect using the provided Coordinate and dimensions. + */ + static createFromPoint(position: Coordinate, width: number, height: number): Rect { + const left = position.x; + const top = position.y; + return new Rect(top, top + height, left, left + width); } } diff --git a/core/workspace_svg.ts b/core/workspace_svg.ts index aad748105..a92c3f4ae 100644 --- a/core/workspace_svg.ts +++ b/core/workspace_svg.ts @@ -1644,23 +1644,48 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { return boundary; } - /** Clean up the workspace by ordering all the blocks in a column. */ - cleanUp() { + /** Tidy up the workspace by ordering all the blocks in a column such that none overlap. */ + tidyUp() { this.setResizesEnabled(false); eventUtils.setGroup(true); + const topBlocks = this.getTopBlocks(true); - let cursorY = 0; - for (let i = 0, block; (block = topBlocks[i]); i++) { - if (!block.isMovable()) { - continue; + const movableBlocks = topBlocks.filter((block) => block.isMovable()); + const immovableBlocks = topBlocks.filter((block) => !block.isMovable()); + + const immovableBlockBounds = immovableBlocks.map((block) => block.getBoundingRectangle()); + + const getNextIntersectingImmovableBlock = function(rect: Rect): Rect|null { + for (const immovableRect of immovableBlockBounds) { + if (rect.intersects(immovableRect)) { + return immovableRect; + } } - const xy = block.getRelativeToSurfaceXY(); - block.moveBy(-xy.x, cursorY - xy.y, ['cleanup']); + return null; + }; + + let cursorY = 0; + const minBlockHeight = this.renderer.getConstants().MIN_BLOCK_HEIGHT; + for (const block of movableBlocks) { + // Make the initial movement of shifting the block to its best possible position. + let boundingRect = block.getBoundingRectangle(); + block.moveBy(-boundingRect.left, cursorY - boundingRect.top, ['cleanup']); block.snapToGrid(); - cursorY = - block.getRelativeToSurfaceXY().y + - block.getHeightWidth().height + - this.renderer.getConstants().MIN_BLOCK_HEIGHT; + + boundingRect = block.getBoundingRectangle(); + let conflictingRect = getNextIntersectingImmovableBlock(boundingRect); + while (conflictingRect != null) { + // If the block intersects with an immovable block, move it down past that immovable block. + cursorY = conflictingRect.top + conflictingRect.getHeight() + minBlockHeight; + block.moveBy(0, cursorY - boundingRect.top, ['cleanup']); + block.snapToGrid(); + boundingRect = block.getBoundingRectangle(); + conflictingRect = getNextIntersectingImmovableBlock(boundingRect); + } + + // Ensure all next blocks start past the most recent (which will also put them past all + // previously intersecting immovable blocks). + cursorY = block.getRelativeToSurfaceXY().y + block.getHeightWidth().height + minBlockHeight; } eventUtils.setGroup(false); this.setResizesEnabled(true); diff --git a/demos/blockfactory/workspacefactory/wfactory_controller.js b/demos/blockfactory/workspacefactory/wfactory_controller.js index 385feede8..7e2f95c81 100644 --- a/demos/blockfactory/workspacefactory/wfactory_controller.js +++ b/demos/blockfactory/workspacefactory/wfactory_controller.js @@ -278,7 +278,7 @@ WorkspaceFactoryController.prototype.clearAndLoadElement = function(id) { this.view.setCategoryTabSelection(id, true); // Order blocks as shown in flyout. - this.toolboxWorkspace.cleanUp(); + this.toolboxWorkspace.tidyUp(); // Update category editing buttons. this.view.updateState(this.model.getIndexByElementId @@ -774,7 +774,7 @@ WorkspaceFactoryController.prototype.importToolboxFromTree_ = function(tree) { // No categories present. // Load all the blocks into a single category evenly spaced. Blockly.Xml.domToWorkspace(tree, this.toolboxWorkspace); - this.toolboxWorkspace.cleanUp(); + this.toolboxWorkspace.tidyUp(); // Convert actual shadow blocks to user-generated shadow blocks. this.convertShadowBlocks(); @@ -799,7 +799,7 @@ WorkspaceFactoryController.prototype.importToolboxFromTree_ = function(tree) { } // Evenly space the blocks. - this.toolboxWorkspace.cleanUp(); + this.toolboxWorkspace.tidyUp(); // Convert actual shadow blocks to user-generated shadow blocks. this.convertShadowBlocks(); diff --git a/tests/mocha/contextmenu_items_test.js b/tests/mocha/contextmenu_items_test.js index b5d480c37..ff6f4fe91 100644 --- a/tests/mocha/contextmenu_items_test.js +++ b/tests/mocha/contextmenu_items_test.js @@ -123,7 +123,7 @@ suite('Context Menu Items', function () { suite('Cleanup', function () { setup(function () { this.cleanupOption = this.registry.getItem('cleanWorkspace'); - this.cleanupStub = sinon.stub(this.workspace, 'cleanUp'); + this.tidyUpStub = sinon.stub(this.workspace, 'tidyUp'); }); test('Enabled when multiple blocks', function () { @@ -153,9 +153,9 @@ suite('Context Menu Items', function () { ); }); - test('Calls workspace cleanup', function () { + test('Calls workspace tidyUp', function () { this.cleanupOption.callback(this.scope); - sinon.assert.calledOnce(this.cleanupStub); + sinon.assert.calledOnce(this.tidyUpStub); }); test('Has correct label', function () { diff --git a/tests/mocha/index.html b/tests/mocha/index.html index ff3467907..adc63da4a 100644 --- a/tests/mocha/index.html +++ b/tests/mocha/index.html @@ -110,6 +110,7 @@ import './old_workspace_comment_test.js'; import './procedure_map_test.js'; import './blocks/procedures_test.js'; + import './rect_test.js'; import './registry_test.js'; import './render_management_test.js'; import './serializer_test.js'; diff --git a/tests/mocha/rect_test.js b/tests/mocha/rect_test.js new file mode 100644 index 000000000..67b116be0 --- /dev/null +++ b/tests/mocha/rect_test.js @@ -0,0 +1,968 @@ +/** + * @license + * Copyright 2024 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +import {assert} from '../../node_modules/chai/chai.js'; +import { + sharedTestSetup, + sharedTestTeardown, +} from './test_helpers/setup_teardown.js'; + +suite('Rect', function () { + setup(function () { + sharedTestSetup.call(this); + this.createCoord = function(x, y) { + return new Blockly.utils.Coordinate(x, y); + }; + }); + teardown(function () { + sharedTestTeardown.call(this); + }); + + suite('Rect()', function () { + test('initializes properties correctly', function() { + const rect = new Blockly.utils.Rect(1, 2, 3, 4); + + assert.equal(rect.top, 1, 'top should be initialized'); + assert.equal(rect.bottom, 2, 'bottom should be initialized'); + assert.equal(rect.left, 3, 'left should be initialized'); + assert.equal(rect.right, 4, 'right should be initialized'); + }); + }); + + suite('createFromPoint()', function () { + test('initializes properties correctly', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); + + assert.equal(rect.top, 2, 'top should be initialized'); + assert.equal(rect.bottom, 47, 'bottom should be initialized'); + assert.equal(rect.left, 1, 'left should be initialized'); + assert.equal(rect.right, 24, 'right should be initialized'); + }); + }); + + suite('clone()', function () { + test('copies properties correctly', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); + + const clonedRect = rect.clone(); + + assert.equal(clonedRect.top, rect.top, 'top should be cloned'); + assert.equal(clonedRect.bottom, rect.bottom, 'bottom should be cloned'); + assert.equal(clonedRect.left, rect.left, 'left should be cloned'); + assert.equal(clonedRect.right, rect.right, 'right should be cloned'); + }); + }); + + suite('equals()', function () { + test('same object instance should equal itself', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); + + const areEqual = Blockly.utils.Rect.equals(rect, rect) + + assert.isTrue(areEqual, 'an instance should equal itself'); + }); + + test('null instances should be equal', function() { + const areEqual = Blockly.utils.Rect.equals(null, null) + + assert.isTrue(areEqual, 'null should equal null'); + }); + + test('an object and null should not be equal', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); + + const areEqual = Blockly.utils.Rect.equals(rect, null) + + assert.isFalse(areEqual, 'non-null should not equal null'); + }); + + test('null and an object should not be equal', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); + + const areEqual = Blockly.utils.Rect.equals(null, rect) + + assert.isFalse(areEqual, 'null should not equal non-null'); + }); + + test('object should equal its clone', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); + + const areEqual = Blockly.utils.Rect.equals(rect, rect.clone()) + + assert.isTrue(areEqual, 'an instance and its clone should be equal'); + }); + + test('object should equal its clone', function() { + const rect1 = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); + const rect2 = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); + + const areEqual = Blockly.utils.Rect.equals(rect1, rect2) + + assert.isTrue(areEqual, 'two objects constructed in the same way should be equal'); + }); + + test('object should not equal object with different x position', function() { + const rect1 = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); + const rect2 = Blockly.utils.Rect.createFromPoint(this.createCoord(3, 2), 23, 45); + + const areEqual = Blockly.utils.Rect.equals(rect1, rect2) + + assert.isFalse(areEqual, 'two objects with different x positions should not be equal'); + }); + + test('object should not equal object with different y position', function() { + const rect1 = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); + const rect2 = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 4), 23, 45); + + const areEqual = Blockly.utils.Rect.equals(rect1, rect2) + + assert.isFalse(areEqual, 'two objects with different y positions should not be equal'); + }); + + test('object should not equal object with different x and y positions', function() { + const rect1 = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); + const rect2 = Blockly.utils.Rect.createFromPoint(this.createCoord(3, 4), 23, 45); + + const areEqual = Blockly.utils.Rect.equals(rect1, rect2) + + assert.isFalse(areEqual, 'two objects with different x/y positions should not be equal'); + }); + + test('object should not equal object with different width', function() { + const rect1 = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); + const rect2 = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 46, 45); + + const areEqual = Blockly.utils.Rect.equals(rect1, rect2) + + assert.isFalse(areEqual, 'two objects with different widths should not be equal'); + }); + + test('object should not equal object with different height', function() { + const rect1 = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); + const rect2 = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 89); + + const areEqual = Blockly.utils.Rect.equals(rect1, rect2) + + assert.isFalse(areEqual, 'two objects with different heights should not be equal'); + }); + + test('object should not equal object with all different properties', function() { + const rect1 = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); + const rect2 = Blockly.utils.Rect.createFromPoint(this.createCoord(3, 4), 46, 89); + + const areEqual = Blockly.utils.Rect.equals(rect1, rect2) + + assert.isFalse(areEqual, 'two objects with all different properties should not be equal'); + }); + }); + + suite('getHeight()', function () { + test('computes zero height for empty rectangle', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(0, 0), 0, 0); + + assert.equal(rect.getHeight(), 0, 'height should be 0'); + }); + + test('computes height of 1 for unit square rectangle', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(0, 0), 1, 1); + + assert.equal(rect.getHeight(), 1, 'height should be 1'); + }); + + test('computes height of 1 for unit square rectangle not at origin', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 1, 1); + + assert.equal(rect.getHeight(), 1, 'height should be 1'); + }); + + test('computes height of 1 for unit square rectangle with negative position', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(-1, -2), 1, 1); + + assert.equal(rect.getHeight(), 1, 'height should be 1'); + }); + + test('computes decimal height for non-square rectangle not at origin', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1.1, 2.2), 3.3, 4.4); + + assert.approximately(rect.getHeight(), 4.4, 1e-5, 'height should be 4.4'); + }); + }); + + suite('getWidth()', function () { + test('computes zero width for empty rectangle', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(0, 0), 0, 0); + + assert.equal(rect.getWidth(), 0, 'width should be 0'); + }); + + test('computes width of 1 for unit square rectangle', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(0, 0), 1, 1); + + assert.equal(rect.getWidth(), 1, 'width should be 1'); + }); + + test('computes width of 1 for unit square rectangle not at origin', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 1, 1); + + assert.equal(rect.getWidth(), 1, 'width should be 1'); + }); + + test('computes width of 1 for unit square rectangle with negative position', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(-1, -2), 1, 1); + + assert.equal(rect.getWidth(), 1, 'width should be 1'); + }); + + test('computes decimal width for non-square rectangle not at origin', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1.1, 2.2), 3.3, 4.4); + + assert.approximately(rect.getWidth(), 3.3, 1e-5, 'width should be 3.3'); + }); + }); + + suite('contains()', function () { + suite('point contained within rect', function () { + test('origin for zero-sized square', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(0, 0), 0, 0); + + const isContained = rect.contains(0, 0); + + assert.isTrue(isContained, 'Rect contains (0, 0)'); + }); + + test('whole number centroid for square at origin', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(0, 0), 2, 2); + + const isContained = rect.contains(1, 1); + + assert.isTrue(isContained, 'Rect contains (1, 1)'); + }); + + test('decimal number centroid for square at origin', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(0, 0), 1, 1); + + const isContained = rect.contains(0.5, 0.5); + + assert.isTrue(isContained, 'Rect contains (0.5, 0.5)'); + }); + + test('centroid for non-square not at origin', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + + const isContained = rect.contains(2.5, 4); + + assert.isTrue(isContained, 'Rect contains (2.5, 4)'); + }); + + test('negative centroid for non-square not at origin', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(-10, -20), 3, 5); + + const isContained = rect.contains(-8.5, -17.5); + + assert.isTrue(isContained, 'Rect contains (-8.5, -17.5)'); + }); + + test('NW corner', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + + const isContained = rect.contains(1, 2); + + assert.isTrue(isContained, 'Rect contains (1, 2)'); + }); + + test('NE corner', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + + const isContained = rect.contains(4, 2); + + assert.isTrue(isContained, 'Rect contains (4, 2)'); + }); + + test('SW corner', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + + const isContained = rect.contains(1, 6); + + assert.isTrue(isContained, 'Rect contains (1, 6)'); + }); + + test('SE corner', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + + const isContained = rect.contains(4, 6); + + assert.isTrue(isContained, 'Rect contains (4, 6)'); + }); + + test('left edge midpoint', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + + const isContained = rect.contains(1, 4); + + assert.isTrue(isContained, 'Rect contains (1, 4)'); + }); + + test('right edge midpoint', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + + const isContained = rect.contains(4, 4); + + assert.isTrue(isContained, 'Rect contains (4, 4)'); + }); + + test('top edge midpoint', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + + const isContained = rect.contains(2.5, 2); + + assert.isTrue(isContained, 'Rect contains (2.5, 2)'); + }); + + test('bottom edge midpoint', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + + const isContained = rect.contains(2.5, 6); + + assert.isTrue(isContained, 'Rect contains (2.5, 6)'); + }); + }); + suite('point not contained within rect', function () { + test('non-origin for zero-sized square', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(0, 0), 0, 0); + + const isContained = rect.contains(0.1, 0.1); + + assert.isFalse(isContained, 'Rect does not contain (0.1, 0.1)'); + }); + + test('point at midpoint x but above unit square', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); + + const isContained = rect.contains(2, 0); + + assert.isFalse(isContained, 'Rect does not contain (2, 0)'); + }); + + test('point at midpoint x but below unit square', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); + + const isContained = rect.contains(2, 4); + + assert.isFalse(isContained, 'Rect does not contain (2, 4)'); + }); + + test('point at midpoint y but left of unit square', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); + + const isContained = rect.contains(0, 2); + + assert.isFalse(isContained, 'Rect does not contain (0, 2)'); + }); + + test('point at midpoint y but right of unit square', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); + + const isContained = rect.contains(4, 2); + + assert.isFalse(isContained, 'Rect does not contain (4, 2)'); + }); + + test('positive point far outside positive rectangle', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + + const isContained = rect.contains(45, 89); + + assert.isFalse(isContained, 'Rect does not contain (45, 89)'); + }); + + test('negative point far outside positive rectangle', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + + const isContained = rect.contains(-45, -89); + + assert.isFalse(isContained, 'Rect does not contain (-45, -89)'); + }); + + test('positive point far outside negative rectangle', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(-10, -20), 3, 5); + + const isContained = rect.contains(45, 89); + + assert.isFalse(isContained, 'Rect does not contain (45, 89)'); + }); + + test('negative point far outside negative rectangle', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(-10, -20), 3, 5); + + const isContained = rect.contains(-45, -89); + + assert.isFalse(isContained, 'Rect does not contain (-45, -89)'); + }); + + test('Point just outside NW corner', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + + const isContained = rect.contains(0.9, 1.9); + + assert.isFalse(isContained, 'Rect does not contain (0.9, 1.9)'); + }); + + test('Point just outside NE corner', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + + const isContained = rect.contains(4.1, 1.9); + + assert.isFalse(isContained, 'Rect does not contain (4.1, 1.9)'); + }); + + test('Point just outside SW corner', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + + const isContained = rect.contains(0.9, 6.1); + + assert.isFalse(isContained, 'Rect does not contain (0.9, 6.1)'); + }); + + test('Point just outside SE corner', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + + const isContained = rect.contains(4.1, 6.1); + + assert.isFalse(isContained, 'Rect does not contain (4.1, 6.1)'); + }); + + test('Point just outside left edge midpoint', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + + const isContained = rect.contains(0.9, 4); + + assert.isFalse(isContained, 'Rect does not contain (0.9, 4)'); + }); + + test('Point just outside right edge midpoint', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + + const isContained = rect.contains(4.1, 4); + + assert.isFalse(isContained, 'Rect does not contain (4.1, 4)'); + }); + + test('Point just outside top edge midpoint', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + + const isContained = rect.contains(2.5, 1.9); + + assert.isFalse(isContained, 'Rect does not contain (2.5, 1.9)'); + }); + + test('Point just outside bottom edge midpoint', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + + const isContained = rect.contains(2.5, 6.1); + + assert.isFalse(isContained, 'Rect does not contain (2.5, 6.1)'); + }); + }); + }); + + // NOTE TO DEVELOPER: For intersection tests, rects are either large (dimension size '2') or small + // (dimension size '1'). For compactness, the comments denoting the scenario being tested try to + // label larger rects with '2' where they can fit, but smaller rects are generally too small to + // fit any text. + suite('intersects()', function () { + suite('does intersect', function () { + test('rect and itself', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); + + const doIntersect = rect.intersects(rect); + + assert.isTrue(doIntersect, 'a rect always intersects with itself'); + }); + + test('rect and its clone', function() { + const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); + + const doIntersect = rect.intersects(rect.clone()); + + assert.isTrue(doIntersect, 'a rect always intersects with its clone'); + }); + + test('two rects of the same positions and dimensions', function() { + const rect1 = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); + const rect2 = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); + + const doIntersect = rect1.intersects(rect2); + + assert.isTrue(doIntersect, 'two rects with the same positions and dimensions intersect'); + }); + + test('upper left/lower right', function() { + // ┌───┐ + // │2┌───┐ + // └─│─┘2│ + // └───┘ + const nwRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); + const seRect = Blockly.utils.Rect.createFromPoint(this.createCoord(2, 2), 2, 2); + + const doIntersectOneWay = nwRect.intersects(seRect); + const doIntersectOtherWay = seRect.intersects(nwRect); + + assert.isTrue(doIntersectOneWay, 'SE corner of NW rect intersects with SE rect'); + assert.isTrue(doIntersectOtherWay, 'NW corner of SE rect intersects with NW rect'); + }); + + test('upper right/lower left', function() { + // ┌───┐ + // ┌───┐2│ + // │2└─│─┘ + // └───┘ + const neRect = Blockly.utils.Rect.createFromPoint(this.createCoord(2, 1), 2, 2); + const swRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 2, 2); + + const doIntersectOneWay = neRect.intersects(swRect); + const doIntersectOtherWay = swRect.intersects(neRect); + + assert.isTrue(doIntersectOneWay, 'SW corner of NE rect intersects with SW rect'); + assert.isTrue(doIntersectOtherWay, 'NE corner of SW rect intersects with NE rect'); + }); + + test('small rect overlapping left side of big rect', function() { + // ┌────┐ + // ┌───┐2 │ + // └───┘ │ + // └────┘ + const bigRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); + const smallRect = Blockly.utils.Rect.createFromPoint(this.createCoord(0.5, 1.5), 1, 1); + + const doIntersectOneWay = bigRect.intersects(smallRect); + const doIntersectOtherWay = smallRect.intersects(bigRect); + + assert.isTrue(doIntersectOneWay, 'big rect intersects top/bottom sides of small rect'); + assert.isTrue(doIntersectOtherWay, 'small rect intersects left side of big rect'); + }); + + test('small rect overlapping right side of big rect', function() { + // ┌────┐ + // │ 2┌───┐ + // │ └───┘ + // └────┘ + const bigRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); + const smallRect = Blockly.utils.Rect.createFromPoint(this.createCoord(2.5, 1.5), 1, 1); + + const doIntersectOneWay = bigRect.intersects(smallRect); + const doIntersectOtherWay = smallRect.intersects(bigRect); + + assert.isTrue(doIntersectOneWay, 'big rect intersects top/bottom sides of small rect'); + assert.isTrue(doIntersectOtherWay, 'small rect intersects right side of big rect'); + }); + + test('small rect overlapping top side of big rect', function() { + // ┌─┐ + // ┌│─│┐ + // │└─┘│ + // └───┘ + const bigRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); + const smallRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1.5, 0.5), 1, 1); + + const doIntersectOneWay = bigRect.intersects(smallRect); + const doIntersectOtherWay = smallRect.intersects(bigRect); + + assert.isTrue(doIntersectOneWay, 'big rect intersects left/right sides of small rect'); + assert.isTrue(doIntersectOtherWay, 'small rect intersects top side of big rect'); + }); + + test('small rect overlapping bottom side of big rect', function() { + // ┌───┐ + // │┌─┐│ + // └│─│┘ + // └─┘ + const bigRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); + const smallRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1.5, 2.5), 1, 1); + + const doIntersectOneWay = bigRect.intersects(smallRect); + const doIntersectOtherWay = smallRect.intersects(bigRect); + + assert.isTrue(doIntersectOneWay, 'big rect intersects left/right sides of small rect'); + assert.isTrue(doIntersectOtherWay, 'small rect intersects bottom side of big rect'); + }); + + test('edge only intersection with all corners outside each rect', function() { + // ┌─┐ + // │ │ + // ┌─────┐ + // └─────┘ + // │ │ + // └─┘ + const tallRect = Blockly.utils.Rect.createFromPoint(this.createCoord(2, 1), 1, 2); + const wideRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 2, 1); + + const doIntersectOneWay = tallRect.intersects(wideRect); + const doIntersectOtherWay = wideRect.intersects(tallRect); + + assert.isTrue(doIntersectOneWay, 'tall rect intersects top/bottom of wide rect'); + assert.isTrue(doIntersectOtherWay, 'wide rect intersects left/right of tall rect'); + }); + + test('small rect within larger rect', function() { + // ┌─────┐ + // │ ┌─┐ │ + // │ └─┘ │ + // └─────┘ + const bigRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); + const smallRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1.5, 1.5), 1, 1); + + const doIntersectOneWay = bigRect.intersects(smallRect); + const doIntersectOtherWay = smallRect.intersects(bigRect); + + assert.isTrue(doIntersectOneWay, 'big rect intersects small rect since it is contained'); + assert.isTrue(doIntersectOtherWay, 'small rect intersects big rect since it is contained'); + }); + + test('rects overlapping on left/right sides', function() { + // ┌──┌────┐ + // │ 2│ │2 │ + // └──└────┘ + const leftRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); + const rightRect = Blockly.utils.Rect.createFromPoint(this.createCoord(2, 1), 2, 2); + + const doIntersectOneWay = leftRect.intersects(rightRect); + const doIntersectOtherWay = rightRect.intersects(leftRect); + + assert.isTrue(doIntersectOneWay, 'Left rect\'s right overlaps with right rect\'s left'); + assert.isTrue(doIntersectOtherWay, 'Right rect\'s left overlaps with left rect\'s right'); + }); + + test('rects overlapping on top/bottom sides', function() { + // ┌───┐ + // ┌───┐ + // │───│ + // └───┘ + const topRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); + const bottomRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 2, 2); + + const doIntersectOneWay = topRect.intersects(bottomRect); + const doIntersectOtherWay = bottomRect.intersects(topRect); + + assert.isTrue(doIntersectOneWay, 'Top rect\'s bottom overlaps with bottom rect\'s top'); + assert.isTrue(doIntersectOtherWay, 'Bottom rect\'s top overlaps with top rect\'s bottom'); + }); + + test('rects adjacent on left/right sides', function() { + // ┌───┬───┐ + // │ 2 │ 2 │ + // └───┴───┘ + const leftRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); + const rightRect = Blockly.utils.Rect.createFromPoint(this.createCoord(3, 1), 2, 2); + + const doIntersectOneWay = leftRect.intersects(rightRect); + const doIntersectOtherWay = rightRect.intersects(leftRect); + + assert.isTrue(doIntersectOneWay, 'Left rect\'s right intersects with right rect\'s left'); + assert.isTrue(doIntersectOtherWay, 'Right rect\'s left intersects with left rect\'s right'); + }); + + test('rects adjacent on top/bottom sides', function() { + // ┌───┐ + // │ 2 │ + // ├───┤ + // │ 2 │ + // └───┘ + const topRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); + const bottomRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 3), 2, 2); + + const doIntersectOneWay = topRect.intersects(bottomRect); + const doIntersectOtherWay = bottomRect.intersects(topRect); + + assert.isTrue(doIntersectOneWay, 'Top rect\'s bottom intersects with bottom rect\'s top'); + assert.isTrue(doIntersectOtherWay, 'Bottom rect\'s top intersects with top rect\'s bottom'); + }); + + test('small left rect adjacent to big right rect', function() { + // ┌───┐ + // ┌─┐ 2 │ + // └─┘ │ + // └───┘ + const bigRect = Blockly.utils.Rect.createFromPoint(this.createCoord(2, 1), 2, 2); + const smallRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1.5), 1, 1); + + const doIntersectOneWay = bigRect.intersects(smallRect); + const doIntersectOtherWay = smallRect.intersects(bigRect); + + assert.isTrue(doIntersectOneWay, 'big rect\'s left intersects small rect\'s right'); + assert.isTrue(doIntersectOtherWay, 'small rect\'s right intersects big rect\'s left'); + }); + + test('small right rect adjacent to big left rect', function() { + // ┌───┐ + // │ 2 ┌─┐ + // │ └─┘ + // └───┘ + const bigRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); + const smallRect = Blockly.utils.Rect.createFromPoint(this.createCoord(3, 1.5), 1, 1); + + const doIntersectOneWay = bigRect.intersects(smallRect); + const doIntersectOtherWay = smallRect.intersects(bigRect); + + assert.isTrue(doIntersectOneWay, 'big rect\'s right intersects small rect\'s left'); + assert.isTrue(doIntersectOtherWay, 'small rect\'s left intersects big rect\'s right'); + }); + + test('small top rect adjacent to big bottom rect', function() { + // ┌─┐ + // ┌└─┘┐ + // │ 2 │ + // └───┘ + const bigRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); + const smallRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1.5, 0), 1, 1); + + const doIntersectOneWay = bigRect.intersects(smallRect); + const doIntersectOtherWay = smallRect.intersects(bigRect); + + assert.isTrue(doIntersectOneWay, 'big rect\'s top intersects small rect\'s bottom'); + assert.isTrue(doIntersectOtherWay, 'small rect\'s bottom intersects big rect\'s top'); + }); + + test('small bottom rect adjacent to big top rect', function() { + // ┌───┐ + // │ 2 │ + // └┌─┐┘ + // └─┘ + const bigRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); + const smallRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1.5, 3), 1, 1); + + const doIntersectOneWay = bigRect.intersects(smallRect); + const doIntersectOtherWay = smallRect.intersects(bigRect); + + assert.isTrue(doIntersectOneWay, 'big rect\'s bottom intersects small rect\'s top'); + assert.isTrue(doIntersectOtherWay, 'small rect\'s top intersects big rect\'s bottom'); + }); + + test('SW rect corner-adjacent to NE rect', function() { + // ┌───┐ + // │ 2 │ + // ┌───┐───┘ + // │ 2 │ + // └───┘ + const swRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 3), 2, 2); + const neRect = Blockly.utils.Rect.createFromPoint(this.createCoord(3, 1), 2, 2); + + const doIntersectOneWay = swRect.intersects(neRect); + const doIntersectOtherWay = neRect.intersects(swRect); + + assert.isTrue(doIntersectOneWay, 'SW rect intersects with SW corner of NE rect'); + assert.isTrue(doIntersectOtherWay, 'NE rect intersects with NE corner of SW rect'); + }); + + test('NW rect corner-adjacent to SE rect', function() { + // ┌───┐ + // │ 2 │ + // └───┘───┐ + // │ 2 │ + // └───┘ + const nwRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); + const seRect = Blockly.utils.Rect.createFromPoint(this.createCoord(3, 3), 2, 2); + + const doIntersectOneWay = seRect.intersects(nwRect); + const doIntersectOtherWay = nwRect.intersects(seRect); + + assert.isTrue(doIntersectOneWay, 'SE rect intersects with SE corner of NW rect'); + assert.isTrue(doIntersectOtherWay, 'NW rect intersects with NW corner of SE rect'); + }); + }); + suite('does not intersect', function () { + test('Same-size rects nearly side-adjacent', function() { + // ┌───┐ ┌───┐ + // │ 2 │ │ 2 │ + // └───┘ └───┘ + const westRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); + const eastRect = Blockly.utils.Rect.createFromPoint(this.createCoord(3.5, 1), 2, 2); + + const doIntersectOneWay = westRect.intersects(eastRect); + const doIntersectOtherWay = eastRect.intersects(westRect); + + assert.isFalse(doIntersectOneWay, 'Western rect does not intersect with eastern rect'); + assert.isFalse(doIntersectOtherWay, 'Eastern rect does not intersect with western rect'); + }); + + test('Same-size rects nearly side-adjacent', function() { + // ┌───┐ + // │ 2 │ + // └───┘ + // ┌───┐ + // │ 2 │ + // └───┘ + const northRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); + const southRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 3.5), 2, 2); + + const doIntersectOneWay = northRect.intersects(southRect); + const doIntersectOtherWay = southRect.intersects(northRect); + + assert.isFalse(doIntersectOneWay, 'Northern rect does not intersect with southern rect'); + assert.isFalse(doIntersectOtherWay, 'Southern rect does not intersect with northern rect'); + }); + + test('Small rect left of big rect', function() { + // ┌───┐ + // ┌─┐│ 2 │ + // └─┘│ │ + // └───┘ + const westRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 1, 1); + const eastRect = Blockly.utils.Rect.createFromPoint(this.createCoord(2.5, 1), 2, 2); + + const doIntersectOneWay = westRect.intersects(eastRect); + const doIntersectOtherWay = eastRect.intersects(westRect); + + assert.isFalse(doIntersectOneWay, 'Western rect does not intersect with eastern rect'); + assert.isFalse(doIntersectOtherWay, 'Eastern rect does not intersect with western rect'); + }); + + test('Small rect right of big rect', function() { + // ┌───┐ + // │ 2 │┌─┐ + // │ │└─┘ + // └───┘ + const westRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); + const eastRect = Blockly.utils.Rect.createFromPoint(this.createCoord(3.5, 1), 1, 1); + + const doIntersectOneWay = westRect.intersects(eastRect); + const doIntersectOtherWay = eastRect.intersects(westRect); + + assert.isFalse(doIntersectOneWay, 'Western rect does not intersect with eastern rect'); + assert.isFalse(doIntersectOtherWay, 'Eastern rect does not intersect with western rect'); + }); + + test('Small rect above big rect', function() { + // ┌─┐ + // └─┘ + // ┌───┐ + // │ 2 │ + // └───┘ + const northRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 1, 1); + const southRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2.5), 2, 2); + + const doIntersectOneWay = northRect.intersects(southRect); + const doIntersectOtherWay = southRect.intersects(northRect); + + assert.isFalse(doIntersectOneWay, 'Northern rect does not intersect with southern rect'); + assert.isFalse(doIntersectOtherWay, 'Southern rect does not intersect with northern rect'); + }); + + test('Small rect below big rect', function() { + // ┌───┐ + // │ 2 │ + // └───┘ + // ┌─┐ + // └─┘ + const northRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); + const southRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 3.5), 1, 1); + + const doIntersectOneWay = northRect.intersects(southRect); + const doIntersectOtherWay = southRect.intersects(northRect); + + assert.isFalse(doIntersectOneWay, 'Northern rect does not intersect with southern rect'); + assert.isFalse(doIntersectOtherWay, 'Southern rect does not intersect with northern rect'); + }); + + test('Same-size rects diagonal (NE and SW) to each other', function() { + // ┌───┐ + // │ 2 │ + // └───┘ + // ┌───┐ + // │ 2 │ + // └───┘ + const neRect = Blockly.utils.Rect.createFromPoint(this.createCoord(3.5, 1), 2, 2); + const swRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 3.5), 2, 2); + + const doIntersectOneWay = neRect.intersects(swRect); + const doIntersectOtherWay = swRect.intersects(neRect); + + assert.isFalse(doIntersectOneWay, 'NE rect does not intersect with SW rect'); + assert.isFalse(doIntersectOtherWay, 'SW rect does not intersect with NE rect'); + }); + + test('Same-size rects diagonal (NW and SE) to each other', function() { + // ┌───┐ + // │ 2 │ + // └───┘ + // ┌───┐ + // │ 2 │ + // └───┘ + const nwRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); + const seRect = Blockly.utils.Rect.createFromPoint(this.createCoord(3.5, 3.5), 2, 2); + + const doIntersectOneWay = nwRect.intersects(seRect); + const doIntersectOtherWay = seRect.intersects(nwRect); + + assert.isFalse(doIntersectOneWay, 'NW rect does not intersect with SE rect'); + assert.isFalse(doIntersectOtherWay, 'SE rect does not intersect with NW rect'); + }); + + test('Small rect NE of big rect', function() { + // ┌─┐ + // └─┘ + // ┌───┐ + // │ 2 │ + // └───┘ + const neRect = Blockly.utils.Rect.createFromPoint(this.createCoord(3.5, 1), 1, 1); + const swRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2.5), 2, 2); + + const doIntersectOneWay = neRect.intersects(swRect); + const doIntersectOtherWay = swRect.intersects(neRect); + + assert.isFalse(doIntersectOneWay, 'NE rect does not intersect with SW rect'); + assert.isFalse(doIntersectOtherWay, 'SW rect does not intersect with NE rect'); + }); + + test('Small rect NW of big rect', function() { + // ┌─┐ + // └─┘ + // ┌───┐ + // │ 2 │ + // └───┘ + const nwRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 1, 1); + const seRect = Blockly.utils.Rect.createFromPoint(this.createCoord(2.5, 2.5), 2, 2); + + const doIntersectOneWay = nwRect.intersects(seRect); + const doIntersectOtherWay = seRect.intersects(nwRect); + + assert.isFalse(doIntersectOneWay, 'NW rect does not intersect with SE rect'); + assert.isFalse(doIntersectOtherWay, 'SE rect does not intersect with NW rect'); + }); + + test('Small rect SW of big rect', function() { + // ┌───┐ + // │ 2 │ + // └───┘ + // ┌─┐ + // └─┘ + const neRect = Blockly.utils.Rect.createFromPoint(this.createCoord(2.5, 1), 2, 2); + const swRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 3.5), 1, 1); + + const doIntersectOneWay = neRect.intersects(swRect); + const doIntersectOtherWay = swRect.intersects(neRect); + + assert.isFalse(doIntersectOneWay, 'NE rect does not intersect with SW rect'); + assert.isFalse(doIntersectOtherWay, 'SW rect does not intersect with NE rect'); + }); + + test('Small rect SE of big rect', function() { + // ┌───┐ + // │ 2 │ + // └───┘ + // ┌─┐ + // └─┘ + const nwRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); + const seRect = Blockly.utils.Rect.createFromPoint(this.createCoord(3.5, 3.5), 1, 1); + + const doIntersectOneWay = nwRect.intersects(seRect); + const doIntersectOtherWay = seRect.intersects(nwRect); + + assert.isFalse(doIntersectOneWay, 'NW rect does not intersect with SE rect'); + assert.isFalse(doIntersectOtherWay, 'SE rect does not intersect with NW rect'); + }); + }); + }); +}); diff --git a/tests/mocha/workspace_svg_test.js b/tests/mocha/workspace_svg_test.js index 93f8f7158..b76cd3516 100644 --- a/tests/mocha/workspace_svg_test.js +++ b/tests/mocha/workspace_svg_test.js @@ -16,7 +16,6 @@ import * as eventUtils from '../../build/src/core/events/utils.js'; import { sharedTestSetup, sharedTestTeardown, - workspaceTeardown, } from './test_helpers/setup_teardown.js'; import {testAWorkspace} from './test_helpers/workspace.js'; @@ -408,6 +407,433 @@ suite('WorkspaceSvg', function () { }); }); }); + + suite('tidyUp', function () { + test('empty workspace does not change', function() { + this.workspace.tidyUp(); + + const blocks = this.workspace.getTopBlocks(true); + assert.equal(blocks.length, 0, 'workspace is empty'); + }); + + test('single block at (0, 0) does not change', function() { + const blockJson = { + "type": "math_number", + "x": 0, + "y": 0, + "fields": { + "NUM": 123 + } + }; + Blockly.serialization.blocks.append(blockJson, this.workspace); + + this.workspace.tidyUp(); + + const blocks = this.workspace.getTopBlocks(true); + const origin = new Blockly.utils.Coordinate(0, 0); + assert.equal(blocks.length, 1, 'workspace has one top-level block'); + assert.deepEqual(blocks[0].getRelativeToSurfaceXY(), origin, 'block is at origin'); + }); + + test('single block at (10, 15) is moved to (0, 0)', function() { + const blockJson = { + "type": "math_number", + "x": 10, + "y": 15, + "fields": { + "NUM": 123 + } + }; + Blockly.serialization.blocks.append(blockJson, this.workspace); + + this.workspace.tidyUp(); + + const topBlocks = this.workspace.getTopBlocks(true); + const allBlocks = this.workspace.getAllBlocks(false); + const origin = new Blockly.utils.Coordinate(0, 0); + assert.equal(topBlocks.length, 1, 'workspace has one top-level block'); + assert.equal(allBlocks.length, 1, 'workspace has one block overall'); + assert.deepEqual(topBlocks[0].getRelativeToSurfaceXY(), origin, 'block is at origin'); + }); + + test('single block at (10, 15) with child is moved as unit to (0, 0)', function() { + const blockJson = { + "type": "logic_negate", + "id": "parent", + "x": 10, + "y": 15, + "inputs": { + "BOOL": { + "block": { + "type": "logic_boolean", + "id": "child", + "fields": { + "BOOL": "TRUE" + } + } + } + } + }; + Blockly.serialization.blocks.append(blockJson, this.workspace); + + this.workspace.tidyUp(); + + const topBlocks = this.workspace.getTopBlocks(true); + const allBlocks = this.workspace.getAllBlocks(false); + const origin = new Blockly.utils.Coordinate(0, 0); + assert.equal(topBlocks.length, 1, 'workspace has one top-level block'); + assert.equal(allBlocks.length, 2, 'workspace has two blocks overall'); + assert.deepEqual(topBlocks[0].getRelativeToSurfaceXY(), origin, 'block is at origin'); + assert.notDeepEqual(allBlocks[1].getRelativeToSurfaceXY(), origin, 'child is not at origin'); + }); + + test('two blocks first at (10, 15) second at (0, 0) do not switch places', function() { + const blockJson1 = { + "type": "math_number", + "id": "block1", + "x": 10, + "y": 15, + "fields": { + "NUM": 123 + } + }; + const blockJson2 = {...blockJson1, "id": "block2", "x": 0, "y": 0}; + Blockly.serialization.blocks.append(blockJson1, this.workspace); + Blockly.serialization.blocks.append(blockJson2, this.workspace); + + this.workspace.tidyUp(); + + // block1 and block2 do not switch places since blocks are pre-sorted by their position before + // being tidied up, so the order they were added to the workspace doesn't matter. + const topBlocks = this.workspace.getTopBlocks(true); + const block1 = this.workspace.getBlockById('block1'); + const block2 = this.workspace.getBlockById('block2'); + const origin = new Blockly.utils.Coordinate(0, 0); + const belowBlock2 = new Blockly.utils.Coordinate(0, 50); + assert.equal(topBlocks.length, 2, 'workspace has two top-level blocks'); + assert.deepEqual(block2.getRelativeToSurfaceXY(), origin, 'block2 is at origin'); + assert.deepEqual(block1.getRelativeToSurfaceXY(), belowBlock2, 'block1 is below block2'); + }); + + test('two overlapping blocks are moved to origin and below', function() { + const blockJson1 = { + "type": "math_number", + "id": "block1", + "x": 25, + "y": 15, + "fields": { + "NUM": 123 + } + }; + const blockJson2 = {...blockJson1, "id": "block2", "x": 15.25, "y": 20.25}; + Blockly.serialization.blocks.append(blockJson1, this.workspace); + Blockly.serialization.blocks.append(blockJson2, this.workspace); + + this.workspace.tidyUp(); + + const topBlocks = this.workspace.getTopBlocks(true); + const block1 = this.workspace.getBlockById('block1'); + const block2 = this.workspace.getBlockById('block2'); + const origin = new Blockly.utils.Coordinate(0, 0); + const belowBlock1 = new Blockly.utils.Coordinate(0, 50); + assert.equal(topBlocks.length, 2, 'workspace has two top-level blocks'); + assert.deepEqual(block1.getRelativeToSurfaceXY(), origin, 'block1 is at origin'); + assert.deepEqual(block2.getRelativeToSurfaceXY(), belowBlock1, 'block2 is below block1'); + }); + + test('two overlapping blocks with snapping are moved to grid-aligned positions', function() { + const blockJson1 = { + "type": "math_number", + "id": "block1", + "x": 25, + "y": 15, + "fields": { + "NUM": 123 + } + }; + const blockJson2 = {...blockJson1, "id": "block2", "x": 15.25, "y": 20.25}; + Blockly.serialization.blocks.append(blockJson1, this.workspace); + Blockly.serialization.blocks.append(blockJson2, this.workspace); + this.workspace.getGrid().setSpacing(20); + this.workspace.getGrid().setSnapToGrid(true); + + this.workspace.tidyUp(); + + const topBlocks = this.workspace.getTopBlocks(true); + const block1 = this.workspace.getBlockById('block1'); + const block2 = this.workspace.getBlockById('block2'); + const snappedOffOrigin = new Blockly.utils.Coordinate(10, 10); + const belowBlock1 = new Blockly.utils.Coordinate(10, 70); + assert.equal(topBlocks.length, 2, 'workspace has two top-level blocks'); + assert.deepEqual(block1.getRelativeToSurfaceXY(), snappedOffOrigin, 'block1 is near origin'); + assert.deepEqual(block2.getRelativeToSurfaceXY(), belowBlock1, 'block2 is below block1'); + }); + + test('two overlapping blocks are moved to origin and below including children', function() { + const blockJson1 = { + "type": "logic_negate", + "id": "block1", + "x": 10, + "y": 15, + "inputs": { + "BOOL": { + "block": { + "type": "logic_boolean", + "fields": { + "BOOL": "TRUE" + } + } + } + } + }; + const blockJson2 = {...blockJson1, "id": "block2", "x": 15.25, "y": 20.25}; + Blockly.serialization.blocks.append(blockJson1, this.workspace); + Blockly.serialization.blocks.append(blockJson2, this.workspace); + + this.workspace.tidyUp(); + + const topBlocks = this.workspace.getTopBlocks(true); + const allBlocks = this.workspace.getAllBlocks(false); + const block1 = this.workspace.getBlockById('block1'); + const block2 = this.workspace.getBlockById('block2'); + const origin = new Blockly.utils.Coordinate(0, 0); + const belowBlock1 = new Blockly.utils.Coordinate(0, 50); + const block1Pos = block1.getRelativeToSurfaceXY(); + const block2Pos = block2.getRelativeToSurfaceXY(); + const block1ChildPos = block1.getChildren()[0].getRelativeToSurfaceXY(); + const block2ChildPos = block2.getChildren()[0].getRelativeToSurfaceXY(); + assert.equal(topBlocks.length, 2, 'workspace has two top-level block2'); + assert.equal(allBlocks.length, 4, 'workspace has four blocks overall'); + assert.deepEqual(block1Pos, origin, 'block1 is at origin'); + assert.deepEqual(block2Pos, belowBlock1, 'block2 is below block1'); + assert.isAbove(block1ChildPos.x, block1Pos.x, 'block1\'s child is right of it'); + assert.isBelow(block1ChildPos.y, block2Pos.y, 'block1\'s child is above block 2'); + assert.isAbove(block2ChildPos.x, block2Pos.x, 'block2\'s child is right of it'); + assert.isAbove(block2ChildPos.y, block1Pos.y, 'block2\'s child is below block 1'); + }); + + test('two large overlapping blocks are moved to origin and below', function() { + const blockJson1 = { + "type": "controls_repeat_ext", + "id": "block1", + "x": 10, + "y": 20, + "inputs": { + "TIMES": { + "shadow": { + "type": "math_number", + "fields": { + "NUM": 10 + } + } + }, + "DO": { + "block": { + "type": "controls_if", + "inputs": { + "IF0": { + "block": { + "type": "logic_boolean", + "fields": { + "BOOL": "TRUE" + } + } + }, + "DO0": { + "block": { + "type": "text_print", + "inputs": { + "TEXT": { + "shadow": { + "type": "text", + "fields": { + "TEXT": "abc" + } + } + } + } + } + } + } + } + } + } + }; + const blockJson2 = {...blockJson1, "id": "block2", "x": 20, "y": 30}; + Blockly.serialization.blocks.append(blockJson1, this.workspace); + Blockly.serialization.blocks.append(blockJson2, this.workspace); + + this.workspace.tidyUp(); + + const topBlocks = this.workspace.getTopBlocks(true); + const block1 = this.workspace.getBlockById('block1'); + const block2 = this.workspace.getBlockById('block2'); + const origin = new Blockly.utils.Coordinate(0, 0); + const belowBlock1 = new Blockly.utils.Coordinate(0, 144); + assert.equal(topBlocks.length, 2, 'workspace has two top-level blocks'); + assert.deepEqual(block1.getRelativeToSurfaceXY(), origin, 'block1 is at origin'); + assert.deepEqual(block2.getRelativeToSurfaceXY(), belowBlock1, 'block2 is below block1'); + }); + + test('five overlapping blocks are moved in-order as one column', function() { + const blockJson1 = { + "type": "math_number", + "id": "block1", + "x": 1, + "y": 2, + "fields": { + "NUM": 123 + } + }; + const blockJson2 = {...blockJson1, "id": "block2", "x": 3, "y": 4}; + const blockJson3 = {...blockJson1, "id": "block3", "x": 5, "y": 6}; + const blockJson4 = {...blockJson1, "id": "block4", "x": 7, "y": 8}; + const blockJson5 = {...blockJson1, "id": "block5", "x": 9, "y": 10}; + Blockly.serialization.blocks.append(blockJson1, this.workspace); + Blockly.serialization.blocks.append(blockJson2, this.workspace); + Blockly.serialization.blocks.append(blockJson3, this.workspace); + Blockly.serialization.blocks.append(blockJson4, this.workspace); + Blockly.serialization.blocks.append(blockJson5, this.workspace); + + this.workspace.tidyUp(); + + const topBlocks = this.workspace.getTopBlocks(true); + const block1Pos = this.workspace.getBlockById('block1').getRelativeToSurfaceXY(); + const block2Pos = this.workspace.getBlockById('block2').getRelativeToSurfaceXY(); + const block3Pos = this.workspace.getBlockById('block3').getRelativeToSurfaceXY(); + const block4Pos = this.workspace.getBlockById('block4').getRelativeToSurfaceXY(); + const block5Pos = this.workspace.getBlockById('block5').getRelativeToSurfaceXY(); + const origin = new Blockly.utils.Coordinate(0, 0); + assert.equal(topBlocks.length, 5, 'workspace has five top-level blocks'); + assert.deepEqual(block1Pos, origin, 'block1 is at origin'); + assert.equal(block2Pos.x, 0, 'block2.x is at 0'); + assert.equal(block3Pos.x, 0, 'block3.x is at 0'); + assert.equal(block4Pos.x, 0, 'block4.x is at 0'); + assert.equal(block5Pos.x, 0, 'block5.x is at 0'); + assert.isAbove(block2Pos.y, block1Pos.y, 'block2 is below block1'); + assert.isAbove(block3Pos.y, block2Pos.y, 'block3 is below block2'); + assert.isAbove(block4Pos.y, block3Pos.y, 'block4 is below block3'); + assert.isAbove(block5Pos.y, block4Pos.y, 'block5 is below block4'); + }); + + test('single immovable block at (10, 15) is not moved', function() { + const blockJson = { + "type": "math_number", + "x": 10, + "y": 15, + "movable": false, + "fields": { + "NUM": 123 + } + }; + Blockly.serialization.blocks.append(blockJson, this.workspace); + + this.workspace.tidyUp(); + + const topBlocks = this.workspace.getTopBlocks(true); + const allBlocks = this.workspace.getAllBlocks(false); + const origPos = new Blockly.utils.Coordinate(10, 15); + assert.equal(topBlocks.length, 1, 'workspace has one top-level block'); + assert.equal(allBlocks.length, 1, 'workspace has one block overall'); + assert.deepEqual(topBlocks[0].getRelativeToSurfaceXY(), origPos, 'block is at (10, 15)'); + }); + + test('multiple block types immovable blocks are not moved', function() { + const smallBlockJson = { + "type": "math_number", + "fields": { + "NUM": 123 + } + }; + const largeBlockJson = { + "type": "controls_repeat_ext", + "inputs": { + "TIMES": { + "shadow": { + "type": "math_number", + "fields": { + "NUM": 10 + } + } + }, + "DO": { + "block": { + "type": "controls_if", + "inputs": { + "IF0": { + "block": { + "type": "logic_boolean", + "fields": { + "BOOL": "TRUE" + } + } + }, + "DO0": { + "block": { + "type": "text_print", + "inputs": { + "TEXT": { + "shadow": { + "type": "text", + "fields": { + "TEXT": "abc" + } + } + } + } + } + } + } + } + } + } + }; + // Block 1 overlaps block 2 (immovable) from above. + const blockJson1 = {...smallBlockJson, "id": "block1", "x": 1, "y": 2}; + const blockJson2 = {...smallBlockJson, "id": "block2", "x": 10, "y": 20, "movable": false}; + // Block 3 overlaps block 2 (immovable) from below. + const blockJson3 = {...smallBlockJson, "id": "block3", "x": 2, "y": 30}; + const blockJson4 = {...largeBlockJson, "id": "block4", "x": 3, "y": 40}; + // Block 5 (immovable) will end up overlapping with block 4 since it's large and will be + // moved. + const blockJson5 = {...smallBlockJson, "id": "block5", "x": 20, "y": 200, "movable": false}; + Blockly.serialization.blocks.append(blockJson1, this.workspace); + Blockly.serialization.blocks.append(blockJson2, this.workspace); + Blockly.serialization.blocks.append(blockJson3, this.workspace); + Blockly.serialization.blocks.append(blockJson4, this.workspace); + Blockly.serialization.blocks.append(blockJson5, this.workspace); + + this.workspace.tidyUp(); + + const topBlocks = this.workspace.getTopBlocks(true); + const block1Rect = this.workspace.getBlockById('block1').getBoundingRectangle(); + const block2Rect = this.workspace.getBlockById('block2').getBoundingRectangle(); + const block3Rect = this.workspace.getBlockById('block3').getBoundingRectangle(); + const block4Rect = this.workspace.getBlockById('block4').getBoundingRectangle(); + const block5Rect = this.workspace.getBlockById('block5').getBoundingRectangle(); + assert.equal(topBlocks.length, 5, 'workspace has five top-level blocks'); + // Check that immovable blocks haven't moved. + assert.equal(block2Rect.left, 10, 'block2.x is at 10'); + assert.equal(block2Rect.top, 20, 'block2.y is at 20'); + assert.equal(block5Rect.left, 20, 'block5.x is at 20'); + assert.equal(block5Rect.top, 200, 'block5.y is at 200'); + // Check that movable positions have correctly been left-aligned. + assert.equal(block1Rect.left, 0, 'block1.x is at 0'); + assert.equal(block3Rect.left, 0, 'block3.x is at 0'); + assert.equal(block4Rect.left, 0, 'block4.x is at 0'); + // Block order should be: 2, 1, 3, 5, 4 since 2 and 5 are immovable. + assert.isAbove(block1Rect.top, block2Rect.top, 'block1 is below block2'); + assert.isAbove(block3Rect.top, block1Rect.top, 'block3 is below block1'); + assert.isAbove(block5Rect.top, block3Rect.top, 'block5 is below block3'); + assert.isAbove(block4Rect.top, block5Rect.top, 'block4 is below block5'); + // Ensure no blocks intersect (can check in order due to the position verification above). + assert.isFalse(block2Rect.intersects(block1Rect), "block2/block1 do not intersect"); + assert.isFalse(block1Rect.intersects(block3Rect), "block1/block3 do not intersect"); + assert.isFalse(block3Rect.intersects(block5Rect), "block3/block5 do not intersect"); + assert.isFalse(block5Rect.intersects(block4Rect), "block5/block4 do not intersect"); + }); + }); + suite('Workspace Base class', function () { testAWorkspace(); }); From 0413021b7c4b20017c5d6f9291024a940cce45d9 Mon Sep 17 00:00:00 2001 From: Ben Henning Date: Wed, 21 Aug 2024 21:02:07 +0000 Subject: [PATCH 34/90] Auto-fix formatting issues to address CI failure. --- core/utils/rect.ts | 23 +- core/workspace_svg.ts | 16 +- tests/mocha/rect_test.js | 1286 ++++++++++++++++++++++------- tests/mocha/workspace_svg_test.js | 563 ++++++++----- 4 files changed, 1367 insertions(+), 521 deletions(-) diff --git a/core/utils/rect.ts b/core/utils/rect.ts index adf0d2b94..c7da2a686 100644 --- a/core/utils/rect.ts +++ b/core/utils/rect.ts @@ -77,10 +77,12 @@ export class Rect { // the border's line segment is contained within the other rectangle. The simplified version // used here can be logically interpreted as ensuring that each line segment of 'this' rectangle // is not outside the bounds of the 'other' rectangle (proving there's an intersection). - return (this.left <= other.right) - && (this.right >= other.left) - && (this.bottom >= other.top) - && (this.top <= other.bottom); + return ( + this.left <= other.right && + this.right >= other.left && + this.bottom >= other.top && + this.top <= other.bottom + ); } /** @@ -97,7 +99,12 @@ export class Rect { if (!a || !b) { return false; } - return a.top === b.top && a.bottom === b.bottom && a.left === b.left && a.right === b.right; + return ( + a.top === b.top && + a.bottom === b.bottom && + a.left === b.left && + a.right === b.right + ); } /** @@ -108,7 +115,11 @@ export class Rect { * @param height The height of the rectangle, in pixels. * @returns A newly created Rect using the provided Coordinate and dimensions. */ - static createFromPoint(position: Coordinate, width: number, height: number): Rect { + static createFromPoint( + position: Coordinate, + width: number, + height: number, + ): Rect { const left = position.x; const top = position.y; return new Rect(top, top + height, left, left + width); diff --git a/core/workspace_svg.ts b/core/workspace_svg.ts index cfab07d99..ff47353fe 100644 --- a/core/workspace_svg.ts +++ b/core/workspace_svg.ts @@ -1656,9 +1656,13 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { const movableBlocks = topBlocks.filter((block) => block.isMovable()); const immovableBlocks = topBlocks.filter((block) => !block.isMovable()); - const immovableBlockBounds = immovableBlocks.map((block) => block.getBoundingRectangle()); + const immovableBlockBounds = immovableBlocks.map((block) => + block.getBoundingRectangle(), + ); - const getNextIntersectingImmovableBlock = function(rect: Rect): Rect|null { + const getNextIntersectingImmovableBlock = function ( + rect: Rect, + ): Rect | null { for (const immovableRect of immovableBlockBounds) { if (rect.intersects(immovableRect)) { return immovableRect; @@ -1679,7 +1683,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { let conflictingRect = getNextIntersectingImmovableBlock(boundingRect); while (conflictingRect != null) { // If the block intersects with an immovable block, move it down past that immovable block. - cursorY = conflictingRect.top + conflictingRect.getHeight() + minBlockHeight; + cursorY = + conflictingRect.top + conflictingRect.getHeight() + minBlockHeight; block.moveBy(0, cursorY - boundingRect.top, ['cleanup']); block.snapToGrid(); boundingRect = block.getBoundingRectangle(); @@ -1688,7 +1693,10 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { // Ensure all next blocks start past the most recent (which will also put them past all // previously intersecting immovable blocks). - cursorY = block.getRelativeToSurfaceXY().y + block.getHeightWidth().height + minBlockHeight; + cursorY = + block.getRelativeToSurfaceXY().y + + block.getHeightWidth().height + + minBlockHeight; } eventUtils.setGroup(false); this.setResizesEnabled(true); diff --git a/tests/mocha/rect_test.js b/tests/mocha/rect_test.js index 67b116be0..796e7ec87 100644 --- a/tests/mocha/rect_test.js +++ b/tests/mocha/rect_test.js @@ -13,7 +13,7 @@ import { suite('Rect', function () { setup(function () { sharedTestSetup.call(this); - this.createCoord = function(x, y) { + this.createCoord = function (x, y) { return new Blockly.utils.Coordinate(x, y); }; }); @@ -22,7 +22,7 @@ suite('Rect', function () { }); suite('Rect()', function () { - test('initializes properties correctly', function() { + test('initializes properties correctly', function () { const rect = new Blockly.utils.Rect(1, 2, 3, 4); assert.equal(rect.top, 1, 'top should be initialized'); @@ -33,8 +33,12 @@ suite('Rect', function () { }); suite('createFromPoint()', function () { - test('initializes properties correctly', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); + test('initializes properties correctly', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 23, + 45, + ); assert.equal(rect.top, 2, 'top should be initialized'); assert.equal(rect.bottom, 47, 'bottom should be initialized'); @@ -44,8 +48,12 @@ suite('Rect', function () { }); suite('clone()', function () { - test('copies properties correctly', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); + test('copies properties correctly', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 23, + 45, + ); const clonedRect = rect.clone(); @@ -57,167 +65,300 @@ suite('Rect', function () { }); suite('equals()', function () { - test('same object instance should equal itself', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); + test('same object instance should equal itself', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 23, + 45, + ); - const areEqual = Blockly.utils.Rect.equals(rect, rect) + const areEqual = Blockly.utils.Rect.equals(rect, rect); assert.isTrue(areEqual, 'an instance should equal itself'); }); - test('null instances should be equal', function() { - const areEqual = Blockly.utils.Rect.equals(null, null) + test('null instances should be equal', function () { + const areEqual = Blockly.utils.Rect.equals(null, null); assert.isTrue(areEqual, 'null should equal null'); }); - test('an object and null should not be equal', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); + test('an object and null should not be equal', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 23, + 45, + ); - const areEqual = Blockly.utils.Rect.equals(rect, null) + const areEqual = Blockly.utils.Rect.equals(rect, null); assert.isFalse(areEqual, 'non-null should not equal null'); }); - test('null and an object should not be equal', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); + test('null and an object should not be equal', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 23, + 45, + ); - const areEqual = Blockly.utils.Rect.equals(null, rect) + const areEqual = Blockly.utils.Rect.equals(null, rect); assert.isFalse(areEqual, 'null should not equal non-null'); }); - test('object should equal its clone', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); + test('object should equal its clone', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 23, + 45, + ); - const areEqual = Blockly.utils.Rect.equals(rect, rect.clone()) + const areEqual = Blockly.utils.Rect.equals(rect, rect.clone()); assert.isTrue(areEqual, 'an instance and its clone should be equal'); }); - test('object should equal its clone', function() { - const rect1 = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); - const rect2 = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); + test('object should equal its clone', function () { + const rect1 = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 23, + 45, + ); + const rect2 = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 23, + 45, + ); - const areEqual = Blockly.utils.Rect.equals(rect1, rect2) + const areEqual = Blockly.utils.Rect.equals(rect1, rect2); - assert.isTrue(areEqual, 'two objects constructed in the same way should be equal'); + assert.isTrue( + areEqual, + 'two objects constructed in the same way should be equal', + ); }); - test('object should not equal object with different x position', function() { - const rect1 = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); - const rect2 = Blockly.utils.Rect.createFromPoint(this.createCoord(3, 2), 23, 45); + test('object should not equal object with different x position', function () { + const rect1 = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 23, + 45, + ); + const rect2 = Blockly.utils.Rect.createFromPoint( + this.createCoord(3, 2), + 23, + 45, + ); - const areEqual = Blockly.utils.Rect.equals(rect1, rect2) + const areEqual = Blockly.utils.Rect.equals(rect1, rect2); - assert.isFalse(areEqual, 'two objects with different x positions should not be equal'); + assert.isFalse( + areEqual, + 'two objects with different x positions should not be equal', + ); }); - test('object should not equal object with different y position', function() { - const rect1 = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); - const rect2 = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 4), 23, 45); + test('object should not equal object with different y position', function () { + const rect1 = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 23, + 45, + ); + const rect2 = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 4), + 23, + 45, + ); - const areEqual = Blockly.utils.Rect.equals(rect1, rect2) + const areEqual = Blockly.utils.Rect.equals(rect1, rect2); - assert.isFalse(areEqual, 'two objects with different y positions should not be equal'); + assert.isFalse( + areEqual, + 'two objects with different y positions should not be equal', + ); }); - test('object should not equal object with different x and y positions', function() { - const rect1 = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); - const rect2 = Blockly.utils.Rect.createFromPoint(this.createCoord(3, 4), 23, 45); + test('object should not equal object with different x and y positions', function () { + const rect1 = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 23, + 45, + ); + const rect2 = Blockly.utils.Rect.createFromPoint( + this.createCoord(3, 4), + 23, + 45, + ); - const areEqual = Blockly.utils.Rect.equals(rect1, rect2) + const areEqual = Blockly.utils.Rect.equals(rect1, rect2); - assert.isFalse(areEqual, 'two objects with different x/y positions should not be equal'); + assert.isFalse( + areEqual, + 'two objects with different x/y positions should not be equal', + ); }); - test('object should not equal object with different width', function() { - const rect1 = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); - const rect2 = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 46, 45); + test('object should not equal object with different width', function () { + const rect1 = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 23, + 45, + ); + const rect2 = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 46, + 45, + ); - const areEqual = Blockly.utils.Rect.equals(rect1, rect2) + const areEqual = Blockly.utils.Rect.equals(rect1, rect2); - assert.isFalse(areEqual, 'two objects with different widths should not be equal'); + assert.isFalse( + areEqual, + 'two objects with different widths should not be equal', + ); }); - test('object should not equal object with different height', function() { - const rect1 = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); - const rect2 = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 89); + test('object should not equal object with different height', function () { + const rect1 = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 23, + 45, + ); + const rect2 = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 23, + 89, + ); - const areEqual = Blockly.utils.Rect.equals(rect1, rect2) + const areEqual = Blockly.utils.Rect.equals(rect1, rect2); - assert.isFalse(areEqual, 'two objects with different heights should not be equal'); + assert.isFalse( + areEqual, + 'two objects with different heights should not be equal', + ); }); - test('object should not equal object with all different properties', function() { - const rect1 = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); - const rect2 = Blockly.utils.Rect.createFromPoint(this.createCoord(3, 4), 46, 89); + test('object should not equal object with all different properties', function () { + const rect1 = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 23, + 45, + ); + const rect2 = Blockly.utils.Rect.createFromPoint( + this.createCoord(3, 4), + 46, + 89, + ); - const areEqual = Blockly.utils.Rect.equals(rect1, rect2) + const areEqual = Blockly.utils.Rect.equals(rect1, rect2); - assert.isFalse(areEqual, 'two objects with all different properties should not be equal'); + assert.isFalse( + areEqual, + 'two objects with all different properties should not be equal', + ); }); }); suite('getHeight()', function () { - test('computes zero height for empty rectangle', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(0, 0), 0, 0); + test('computes zero height for empty rectangle', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(0, 0), + 0, + 0, + ); assert.equal(rect.getHeight(), 0, 'height should be 0'); }); - test('computes height of 1 for unit square rectangle', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(0, 0), 1, 1); + test('computes height of 1 for unit square rectangle', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(0, 0), + 1, + 1, + ); assert.equal(rect.getHeight(), 1, 'height should be 1'); }); - test('computes height of 1 for unit square rectangle not at origin', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 1, 1); + test('computes height of 1 for unit square rectangle not at origin', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 1, + 1, + ); assert.equal(rect.getHeight(), 1, 'height should be 1'); }); - test('computes height of 1 for unit square rectangle with negative position', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(-1, -2), 1, 1); + test('computes height of 1 for unit square rectangle with negative position', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(-1, -2), + 1, + 1, + ); assert.equal(rect.getHeight(), 1, 'height should be 1'); }); - test('computes decimal height for non-square rectangle not at origin', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1.1, 2.2), 3.3, 4.4); + test('computes decimal height for non-square rectangle not at origin', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1.1, 2.2), + 3.3, + 4.4, + ); assert.approximately(rect.getHeight(), 4.4, 1e-5, 'height should be 4.4'); }); }); suite('getWidth()', function () { - test('computes zero width for empty rectangle', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(0, 0), 0, 0); + test('computes zero width for empty rectangle', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(0, 0), + 0, + 0, + ); assert.equal(rect.getWidth(), 0, 'width should be 0'); }); - test('computes width of 1 for unit square rectangle', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(0, 0), 1, 1); + test('computes width of 1 for unit square rectangle', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(0, 0), + 1, + 1, + ); assert.equal(rect.getWidth(), 1, 'width should be 1'); }); - test('computes width of 1 for unit square rectangle not at origin', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 1, 1); + test('computes width of 1 for unit square rectangle not at origin', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 1, + 1, + ); assert.equal(rect.getWidth(), 1, 'width should be 1'); }); - test('computes width of 1 for unit square rectangle with negative position', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(-1, -2), 1, 1); + test('computes width of 1 for unit square rectangle with negative position', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(-1, -2), + 1, + 1, + ); assert.equal(rect.getWidth(), 1, 'width should be 1'); }); - test('computes decimal width for non-square rectangle not at origin', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1.1, 2.2), 3.3, 4.4); + test('computes decimal width for non-square rectangle not at origin', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1.1, 2.2), + 3.3, + 4.4, + ); assert.approximately(rect.getWidth(), 3.3, 1e-5, 'width should be 3.3'); }); @@ -225,104 +366,156 @@ suite('Rect', function () { suite('contains()', function () { suite('point contained within rect', function () { - test('origin for zero-sized square', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(0, 0), 0, 0); + test('origin for zero-sized square', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(0, 0), + 0, + 0, + ); const isContained = rect.contains(0, 0); assert.isTrue(isContained, 'Rect contains (0, 0)'); }); - test('whole number centroid for square at origin', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(0, 0), 2, 2); + test('whole number centroid for square at origin', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(0, 0), + 2, + 2, + ); const isContained = rect.contains(1, 1); assert.isTrue(isContained, 'Rect contains (1, 1)'); }); - test('decimal number centroid for square at origin', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(0, 0), 1, 1); + test('decimal number centroid for square at origin', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(0, 0), + 1, + 1, + ); const isContained = rect.contains(0.5, 0.5); assert.isTrue(isContained, 'Rect contains (0.5, 0.5)'); }); - test('centroid for non-square not at origin', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + test('centroid for non-square not at origin', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 3, + 4, + ); const isContained = rect.contains(2.5, 4); assert.isTrue(isContained, 'Rect contains (2.5, 4)'); }); - test('negative centroid for non-square not at origin', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(-10, -20), 3, 5); + test('negative centroid for non-square not at origin', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(-10, -20), + 3, + 5, + ); const isContained = rect.contains(-8.5, -17.5); assert.isTrue(isContained, 'Rect contains (-8.5, -17.5)'); }); - test('NW corner', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + test('NW corner', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 3, + 4, + ); const isContained = rect.contains(1, 2); assert.isTrue(isContained, 'Rect contains (1, 2)'); }); - test('NE corner', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + test('NE corner', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 3, + 4, + ); const isContained = rect.contains(4, 2); assert.isTrue(isContained, 'Rect contains (4, 2)'); }); - test('SW corner', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + test('SW corner', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 3, + 4, + ); const isContained = rect.contains(1, 6); assert.isTrue(isContained, 'Rect contains (1, 6)'); }); - test('SE corner', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + test('SE corner', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 3, + 4, + ); const isContained = rect.contains(4, 6); assert.isTrue(isContained, 'Rect contains (4, 6)'); }); - test('left edge midpoint', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + test('left edge midpoint', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 3, + 4, + ); const isContained = rect.contains(1, 4); assert.isTrue(isContained, 'Rect contains (1, 4)'); }); - test('right edge midpoint', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + test('right edge midpoint', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 3, + 4, + ); const isContained = rect.contains(4, 4); assert.isTrue(isContained, 'Rect contains (4, 4)'); }); - test('top edge midpoint', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + test('top edge midpoint', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 3, + 4, + ); const isContained = rect.contains(2.5, 2); assert.isTrue(isContained, 'Rect contains (2.5, 2)'); }); - test('bottom edge midpoint', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + test('bottom edge midpoint', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 3, + 4, + ); const isContained = rect.contains(2.5, 6); @@ -330,136 +523,204 @@ suite('Rect', function () { }); }); suite('point not contained within rect', function () { - test('non-origin for zero-sized square', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(0, 0), 0, 0); + test('non-origin for zero-sized square', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(0, 0), + 0, + 0, + ); const isContained = rect.contains(0.1, 0.1); assert.isFalse(isContained, 'Rect does not contain (0.1, 0.1)'); }); - test('point at midpoint x but above unit square', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); + test('point at midpoint x but above unit square', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 1), + 2, + 2, + ); const isContained = rect.contains(2, 0); assert.isFalse(isContained, 'Rect does not contain (2, 0)'); }); - test('point at midpoint x but below unit square', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); + test('point at midpoint x but below unit square', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 1), + 2, + 2, + ); const isContained = rect.contains(2, 4); assert.isFalse(isContained, 'Rect does not contain (2, 4)'); }); - test('point at midpoint y but left of unit square', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); + test('point at midpoint y but left of unit square', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 1), + 2, + 2, + ); const isContained = rect.contains(0, 2); assert.isFalse(isContained, 'Rect does not contain (0, 2)'); }); - test('point at midpoint y but right of unit square', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); + test('point at midpoint y but right of unit square', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 1), + 2, + 2, + ); const isContained = rect.contains(4, 2); assert.isFalse(isContained, 'Rect does not contain (4, 2)'); }); - test('positive point far outside positive rectangle', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + test('positive point far outside positive rectangle', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 3, + 4, + ); const isContained = rect.contains(45, 89); assert.isFalse(isContained, 'Rect does not contain (45, 89)'); }); - test('negative point far outside positive rectangle', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + test('negative point far outside positive rectangle', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 3, + 4, + ); const isContained = rect.contains(-45, -89); assert.isFalse(isContained, 'Rect does not contain (-45, -89)'); }); - test('positive point far outside negative rectangle', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(-10, -20), 3, 5); + test('positive point far outside negative rectangle', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(-10, -20), + 3, + 5, + ); const isContained = rect.contains(45, 89); assert.isFalse(isContained, 'Rect does not contain (45, 89)'); }); - test('negative point far outside negative rectangle', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(-10, -20), 3, 5); + test('negative point far outside negative rectangle', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(-10, -20), + 3, + 5, + ); const isContained = rect.contains(-45, -89); assert.isFalse(isContained, 'Rect does not contain (-45, -89)'); }); - test('Point just outside NW corner', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + test('Point just outside NW corner', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 3, + 4, + ); const isContained = rect.contains(0.9, 1.9); assert.isFalse(isContained, 'Rect does not contain (0.9, 1.9)'); }); - test('Point just outside NE corner', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + test('Point just outside NE corner', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 3, + 4, + ); const isContained = rect.contains(4.1, 1.9); assert.isFalse(isContained, 'Rect does not contain (4.1, 1.9)'); }); - test('Point just outside SW corner', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + test('Point just outside SW corner', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 3, + 4, + ); const isContained = rect.contains(0.9, 6.1); assert.isFalse(isContained, 'Rect does not contain (0.9, 6.1)'); }); - test('Point just outside SE corner', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + test('Point just outside SE corner', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 3, + 4, + ); const isContained = rect.contains(4.1, 6.1); assert.isFalse(isContained, 'Rect does not contain (4.1, 6.1)'); }); - test('Point just outside left edge midpoint', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + test('Point just outside left edge midpoint', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 3, + 4, + ); const isContained = rect.contains(0.9, 4); assert.isFalse(isContained, 'Rect does not contain (0.9, 4)'); }); - test('Point just outside right edge midpoint', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + test('Point just outside right edge midpoint', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 3, + 4, + ); const isContained = rect.contains(4.1, 4); assert.isFalse(isContained, 'Rect does not contain (4.1, 4)'); }); - test('Point just outside top edge midpoint', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + test('Point just outside top edge midpoint', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 3, + 4, + ); const isContained = rect.contains(2.5, 1.9); assert.isFalse(isContained, 'Rect does not contain (2.5, 1.9)'); }); - test('Point just outside bottom edge midpoint', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 3, 4); + test('Point just outside bottom edge midpoint', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 3, + 4, + ); const isContained = rect.contains(2.5, 6.1); @@ -474,494 +735,933 @@ suite('Rect', function () { // fit any text. suite('intersects()', function () { suite('does intersect', function () { - test('rect and itself', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); + test('rect and itself', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 23, + 45, + ); const doIntersect = rect.intersects(rect); assert.isTrue(doIntersect, 'a rect always intersects with itself'); }); - test('rect and its clone', function() { - const rect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); + test('rect and its clone', function () { + const rect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 23, + 45, + ); const doIntersect = rect.intersects(rect.clone()); assert.isTrue(doIntersect, 'a rect always intersects with its clone'); }); - test('two rects of the same positions and dimensions', function() { - const rect1 = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); - const rect2 = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 23, 45); + test('two rects of the same positions and dimensions', function () { + const rect1 = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 23, + 45, + ); + const rect2 = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 23, + 45, + ); const doIntersect = rect1.intersects(rect2); - assert.isTrue(doIntersect, 'two rects with the same positions and dimensions intersect'); + assert.isTrue( + doIntersect, + 'two rects with the same positions and dimensions intersect', + ); }); - test('upper left/lower right', function() { + test('upper left/lower right', function () { // ┌───┐ // │2┌───┐ // └─│─┘2│ // └───┘ - const nwRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); - const seRect = Blockly.utils.Rect.createFromPoint(this.createCoord(2, 2), 2, 2); + const nwRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 1), + 2, + 2, + ); + const seRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(2, 2), + 2, + 2, + ); const doIntersectOneWay = nwRect.intersects(seRect); const doIntersectOtherWay = seRect.intersects(nwRect); - assert.isTrue(doIntersectOneWay, 'SE corner of NW rect intersects with SE rect'); - assert.isTrue(doIntersectOtherWay, 'NW corner of SE rect intersects with NW rect'); + assert.isTrue( + doIntersectOneWay, + 'SE corner of NW rect intersects with SE rect', + ); + assert.isTrue( + doIntersectOtherWay, + 'NW corner of SE rect intersects with NW rect', + ); }); - test('upper right/lower left', function() { + test('upper right/lower left', function () { // ┌───┐ // ┌───┐2│ // │2└─│─┘ // └───┘ - const neRect = Blockly.utils.Rect.createFromPoint(this.createCoord(2, 1), 2, 2); - const swRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 2, 2); + const neRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(2, 1), + 2, + 2, + ); + const swRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 2, + 2, + ); const doIntersectOneWay = neRect.intersects(swRect); const doIntersectOtherWay = swRect.intersects(neRect); - assert.isTrue(doIntersectOneWay, 'SW corner of NE rect intersects with SW rect'); - assert.isTrue(doIntersectOtherWay, 'NE corner of SW rect intersects with NE rect'); + assert.isTrue( + doIntersectOneWay, + 'SW corner of NE rect intersects with SW rect', + ); + assert.isTrue( + doIntersectOtherWay, + 'NE corner of SW rect intersects with NE rect', + ); }); - test('small rect overlapping left side of big rect', function() { + test('small rect overlapping left side of big rect', function () { // ┌────┐ // ┌───┐2 │ // └───┘ │ // └────┘ - const bigRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); - const smallRect = Blockly.utils.Rect.createFromPoint(this.createCoord(0.5, 1.5), 1, 1); + const bigRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 1), + 2, + 2, + ); + const smallRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(0.5, 1.5), + 1, + 1, + ); const doIntersectOneWay = bigRect.intersects(smallRect); const doIntersectOtherWay = smallRect.intersects(bigRect); - assert.isTrue(doIntersectOneWay, 'big rect intersects top/bottom sides of small rect'); - assert.isTrue(doIntersectOtherWay, 'small rect intersects left side of big rect'); + assert.isTrue( + doIntersectOneWay, + 'big rect intersects top/bottom sides of small rect', + ); + assert.isTrue( + doIntersectOtherWay, + 'small rect intersects left side of big rect', + ); }); - test('small rect overlapping right side of big rect', function() { + test('small rect overlapping right side of big rect', function () { // ┌────┐ // │ 2┌───┐ // │ └───┘ // └────┘ - const bigRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); - const smallRect = Blockly.utils.Rect.createFromPoint(this.createCoord(2.5, 1.5), 1, 1); + const bigRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 1), + 2, + 2, + ); + const smallRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(2.5, 1.5), + 1, + 1, + ); const doIntersectOneWay = bigRect.intersects(smallRect); const doIntersectOtherWay = smallRect.intersects(bigRect); - assert.isTrue(doIntersectOneWay, 'big rect intersects top/bottom sides of small rect'); - assert.isTrue(doIntersectOtherWay, 'small rect intersects right side of big rect'); + assert.isTrue( + doIntersectOneWay, + 'big rect intersects top/bottom sides of small rect', + ); + assert.isTrue( + doIntersectOtherWay, + 'small rect intersects right side of big rect', + ); }); - test('small rect overlapping top side of big rect', function() { + test('small rect overlapping top side of big rect', function () { // ┌─┐ // ┌│─│┐ // │└─┘│ // └───┘ - const bigRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); - const smallRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1.5, 0.5), 1, 1); + const bigRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 1), + 2, + 2, + ); + const smallRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1.5, 0.5), + 1, + 1, + ); const doIntersectOneWay = bigRect.intersects(smallRect); const doIntersectOtherWay = smallRect.intersects(bigRect); - assert.isTrue(doIntersectOneWay, 'big rect intersects left/right sides of small rect'); - assert.isTrue(doIntersectOtherWay, 'small rect intersects top side of big rect'); + assert.isTrue( + doIntersectOneWay, + 'big rect intersects left/right sides of small rect', + ); + assert.isTrue( + doIntersectOtherWay, + 'small rect intersects top side of big rect', + ); }); - test('small rect overlapping bottom side of big rect', function() { + test('small rect overlapping bottom side of big rect', function () { // ┌───┐ // │┌─┐│ // └│─│┘ // └─┘ - const bigRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); - const smallRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1.5, 2.5), 1, 1); + const bigRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 1), + 2, + 2, + ); + const smallRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1.5, 2.5), + 1, + 1, + ); const doIntersectOneWay = bigRect.intersects(smallRect); const doIntersectOtherWay = smallRect.intersects(bigRect); - assert.isTrue(doIntersectOneWay, 'big rect intersects left/right sides of small rect'); - assert.isTrue(doIntersectOtherWay, 'small rect intersects bottom side of big rect'); + assert.isTrue( + doIntersectOneWay, + 'big rect intersects left/right sides of small rect', + ); + assert.isTrue( + doIntersectOtherWay, + 'small rect intersects bottom side of big rect', + ); }); - test('edge only intersection with all corners outside each rect', function() { + test('edge only intersection with all corners outside each rect', function () { // ┌─┐ // │ │ // ┌─────┐ // └─────┘ // │ │ // └─┘ - const tallRect = Blockly.utils.Rect.createFromPoint(this.createCoord(2, 1), 1, 2); - const wideRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 2, 1); + const tallRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(2, 1), + 1, + 2, + ); + const wideRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 2, + 1, + ); const doIntersectOneWay = tallRect.intersects(wideRect); const doIntersectOtherWay = wideRect.intersects(tallRect); - assert.isTrue(doIntersectOneWay, 'tall rect intersects top/bottom of wide rect'); - assert.isTrue(doIntersectOtherWay, 'wide rect intersects left/right of tall rect'); + assert.isTrue( + doIntersectOneWay, + 'tall rect intersects top/bottom of wide rect', + ); + assert.isTrue( + doIntersectOtherWay, + 'wide rect intersects left/right of tall rect', + ); }); - test('small rect within larger rect', function() { + test('small rect within larger rect', function () { // ┌─────┐ // │ ┌─┐ │ // │ └─┘ │ // └─────┘ - const bigRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); - const smallRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1.5, 1.5), 1, 1); + const bigRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 1), + 2, + 2, + ); + const smallRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1.5, 1.5), + 1, + 1, + ); const doIntersectOneWay = bigRect.intersects(smallRect); const doIntersectOtherWay = smallRect.intersects(bigRect); - assert.isTrue(doIntersectOneWay, 'big rect intersects small rect since it is contained'); - assert.isTrue(doIntersectOtherWay, 'small rect intersects big rect since it is contained'); + assert.isTrue( + doIntersectOneWay, + 'big rect intersects small rect since it is contained', + ); + assert.isTrue( + doIntersectOtherWay, + 'small rect intersects big rect since it is contained', + ); }); - test('rects overlapping on left/right sides', function() { + test('rects overlapping on left/right sides', function () { // ┌──┌────┐ // │ 2│ │2 │ // └──└────┘ - const leftRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); - const rightRect = Blockly.utils.Rect.createFromPoint(this.createCoord(2, 1), 2, 2); + const leftRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 1), + 2, + 2, + ); + const rightRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(2, 1), + 2, + 2, + ); const doIntersectOneWay = leftRect.intersects(rightRect); const doIntersectOtherWay = rightRect.intersects(leftRect); - assert.isTrue(doIntersectOneWay, 'Left rect\'s right overlaps with right rect\'s left'); - assert.isTrue(doIntersectOtherWay, 'Right rect\'s left overlaps with left rect\'s right'); + assert.isTrue( + doIntersectOneWay, + "Left rect's right overlaps with right rect's left", + ); + assert.isTrue( + doIntersectOtherWay, + "Right rect's left overlaps with left rect's right", + ); }); - test('rects overlapping on top/bottom sides', function() { + test('rects overlapping on top/bottom sides', function () { // ┌───┐ // ┌───┐ // │───│ // └───┘ - const topRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); - const bottomRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2), 2, 2); + const topRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 1), + 2, + 2, + ); + const bottomRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2), + 2, + 2, + ); const doIntersectOneWay = topRect.intersects(bottomRect); const doIntersectOtherWay = bottomRect.intersects(topRect); - assert.isTrue(doIntersectOneWay, 'Top rect\'s bottom overlaps with bottom rect\'s top'); - assert.isTrue(doIntersectOtherWay, 'Bottom rect\'s top overlaps with top rect\'s bottom'); + assert.isTrue( + doIntersectOneWay, + "Top rect's bottom overlaps with bottom rect's top", + ); + assert.isTrue( + doIntersectOtherWay, + "Bottom rect's top overlaps with top rect's bottom", + ); }); - test('rects adjacent on left/right sides', function() { + test('rects adjacent on left/right sides', function () { // ┌───┬───┐ // │ 2 │ 2 │ // └───┴───┘ - const leftRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); - const rightRect = Blockly.utils.Rect.createFromPoint(this.createCoord(3, 1), 2, 2); + const leftRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 1), + 2, + 2, + ); + const rightRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(3, 1), + 2, + 2, + ); const doIntersectOneWay = leftRect.intersects(rightRect); const doIntersectOtherWay = rightRect.intersects(leftRect); - assert.isTrue(doIntersectOneWay, 'Left rect\'s right intersects with right rect\'s left'); - assert.isTrue(doIntersectOtherWay, 'Right rect\'s left intersects with left rect\'s right'); + assert.isTrue( + doIntersectOneWay, + "Left rect's right intersects with right rect's left", + ); + assert.isTrue( + doIntersectOtherWay, + "Right rect's left intersects with left rect's right", + ); }); - test('rects adjacent on top/bottom sides', function() { + test('rects adjacent on top/bottom sides', function () { // ┌───┐ // │ 2 │ // ├───┤ // │ 2 │ // └───┘ - const topRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); - const bottomRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 3), 2, 2); + const topRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 1), + 2, + 2, + ); + const bottomRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 3), + 2, + 2, + ); const doIntersectOneWay = topRect.intersects(bottomRect); const doIntersectOtherWay = bottomRect.intersects(topRect); - assert.isTrue(doIntersectOneWay, 'Top rect\'s bottom intersects with bottom rect\'s top'); - assert.isTrue(doIntersectOtherWay, 'Bottom rect\'s top intersects with top rect\'s bottom'); + assert.isTrue( + doIntersectOneWay, + "Top rect's bottom intersects with bottom rect's top", + ); + assert.isTrue( + doIntersectOtherWay, + "Bottom rect's top intersects with top rect's bottom", + ); }); - test('small left rect adjacent to big right rect', function() { + test('small left rect adjacent to big right rect', function () { // ┌───┐ // ┌─┐ 2 │ // └─┘ │ // └───┘ - const bigRect = Blockly.utils.Rect.createFromPoint(this.createCoord(2, 1), 2, 2); - const smallRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1.5), 1, 1); + const bigRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(2, 1), + 2, + 2, + ); + const smallRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 1.5), + 1, + 1, + ); const doIntersectOneWay = bigRect.intersects(smallRect); const doIntersectOtherWay = smallRect.intersects(bigRect); - assert.isTrue(doIntersectOneWay, 'big rect\'s left intersects small rect\'s right'); - assert.isTrue(doIntersectOtherWay, 'small rect\'s right intersects big rect\'s left'); + assert.isTrue( + doIntersectOneWay, + "big rect's left intersects small rect's right", + ); + assert.isTrue( + doIntersectOtherWay, + "small rect's right intersects big rect's left", + ); }); - test('small right rect adjacent to big left rect', function() { + test('small right rect adjacent to big left rect', function () { // ┌───┐ // │ 2 ┌─┐ // │ └─┘ // └───┘ - const bigRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); - const smallRect = Blockly.utils.Rect.createFromPoint(this.createCoord(3, 1.5), 1, 1); + const bigRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 1), + 2, + 2, + ); + const smallRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(3, 1.5), + 1, + 1, + ); const doIntersectOneWay = bigRect.intersects(smallRect); const doIntersectOtherWay = smallRect.intersects(bigRect); - assert.isTrue(doIntersectOneWay, 'big rect\'s right intersects small rect\'s left'); - assert.isTrue(doIntersectOtherWay, 'small rect\'s left intersects big rect\'s right'); + assert.isTrue( + doIntersectOneWay, + "big rect's right intersects small rect's left", + ); + assert.isTrue( + doIntersectOtherWay, + "small rect's left intersects big rect's right", + ); }); - test('small top rect adjacent to big bottom rect', function() { + test('small top rect adjacent to big bottom rect', function () { // ┌─┐ // ┌└─┘┐ // │ 2 │ // └───┘ - const bigRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); - const smallRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1.5, 0), 1, 1); + const bigRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 1), + 2, + 2, + ); + const smallRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1.5, 0), + 1, + 1, + ); const doIntersectOneWay = bigRect.intersects(smallRect); const doIntersectOtherWay = smallRect.intersects(bigRect); - assert.isTrue(doIntersectOneWay, 'big rect\'s top intersects small rect\'s bottom'); - assert.isTrue(doIntersectOtherWay, 'small rect\'s bottom intersects big rect\'s top'); + assert.isTrue( + doIntersectOneWay, + "big rect's top intersects small rect's bottom", + ); + assert.isTrue( + doIntersectOtherWay, + "small rect's bottom intersects big rect's top", + ); }); - test('small bottom rect adjacent to big top rect', function() { + test('small bottom rect adjacent to big top rect', function () { // ┌───┐ // │ 2 │ // └┌─┐┘ // └─┘ - const bigRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); - const smallRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1.5, 3), 1, 1); + const bigRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 1), + 2, + 2, + ); + const smallRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1.5, 3), + 1, + 1, + ); const doIntersectOneWay = bigRect.intersects(smallRect); const doIntersectOtherWay = smallRect.intersects(bigRect); - assert.isTrue(doIntersectOneWay, 'big rect\'s bottom intersects small rect\'s top'); - assert.isTrue(doIntersectOtherWay, 'small rect\'s top intersects big rect\'s bottom'); + assert.isTrue( + doIntersectOneWay, + "big rect's bottom intersects small rect's top", + ); + assert.isTrue( + doIntersectOtherWay, + "small rect's top intersects big rect's bottom", + ); }); - test('SW rect corner-adjacent to NE rect', function() { + test('SW rect corner-adjacent to NE rect', function () { // ┌───┐ // │ 2 │ // ┌───┐───┘ // │ 2 │ // └───┘ - const swRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 3), 2, 2); - const neRect = Blockly.utils.Rect.createFromPoint(this.createCoord(3, 1), 2, 2); + const swRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 3), + 2, + 2, + ); + const neRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(3, 1), + 2, + 2, + ); const doIntersectOneWay = swRect.intersects(neRect); const doIntersectOtherWay = neRect.intersects(swRect); - assert.isTrue(doIntersectOneWay, 'SW rect intersects with SW corner of NE rect'); - assert.isTrue(doIntersectOtherWay, 'NE rect intersects with NE corner of SW rect'); + assert.isTrue( + doIntersectOneWay, + 'SW rect intersects with SW corner of NE rect', + ); + assert.isTrue( + doIntersectOtherWay, + 'NE rect intersects with NE corner of SW rect', + ); }); - test('NW rect corner-adjacent to SE rect', function() { + test('NW rect corner-adjacent to SE rect', function () { // ┌───┐ // │ 2 │ // └───┘───┐ // │ 2 │ // └───┘ - const nwRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); - const seRect = Blockly.utils.Rect.createFromPoint(this.createCoord(3, 3), 2, 2); + const nwRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 1), + 2, + 2, + ); + const seRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(3, 3), + 2, + 2, + ); const doIntersectOneWay = seRect.intersects(nwRect); const doIntersectOtherWay = nwRect.intersects(seRect); - assert.isTrue(doIntersectOneWay, 'SE rect intersects with SE corner of NW rect'); - assert.isTrue(doIntersectOtherWay, 'NW rect intersects with NW corner of SE rect'); + assert.isTrue( + doIntersectOneWay, + 'SE rect intersects with SE corner of NW rect', + ); + assert.isTrue( + doIntersectOtherWay, + 'NW rect intersects with NW corner of SE rect', + ); }); }); suite('does not intersect', function () { - test('Same-size rects nearly side-adjacent', function() { + test('Same-size rects nearly side-adjacent', function () { // ┌───┐ ┌───┐ // │ 2 │ │ 2 │ // └───┘ └───┘ - const westRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); - const eastRect = Blockly.utils.Rect.createFromPoint(this.createCoord(3.5, 1), 2, 2); + const westRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 1), + 2, + 2, + ); + const eastRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(3.5, 1), + 2, + 2, + ); const doIntersectOneWay = westRect.intersects(eastRect); const doIntersectOtherWay = eastRect.intersects(westRect); - assert.isFalse(doIntersectOneWay, 'Western rect does not intersect with eastern rect'); - assert.isFalse(doIntersectOtherWay, 'Eastern rect does not intersect with western rect'); + assert.isFalse( + doIntersectOneWay, + 'Western rect does not intersect with eastern rect', + ); + assert.isFalse( + doIntersectOtherWay, + 'Eastern rect does not intersect with western rect', + ); }); - test('Same-size rects nearly side-adjacent', function() { + test('Same-size rects nearly side-adjacent', function () { // ┌───┐ // │ 2 │ // └───┘ // ┌───┐ // │ 2 │ // └───┘ - const northRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); - const southRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 3.5), 2, 2); + const northRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 1), + 2, + 2, + ); + const southRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 3.5), + 2, + 2, + ); const doIntersectOneWay = northRect.intersects(southRect); const doIntersectOtherWay = southRect.intersects(northRect); - assert.isFalse(doIntersectOneWay, 'Northern rect does not intersect with southern rect'); - assert.isFalse(doIntersectOtherWay, 'Southern rect does not intersect with northern rect'); + assert.isFalse( + doIntersectOneWay, + 'Northern rect does not intersect with southern rect', + ); + assert.isFalse( + doIntersectOtherWay, + 'Southern rect does not intersect with northern rect', + ); }); - test('Small rect left of big rect', function() { + test('Small rect left of big rect', function () { // ┌───┐ // ┌─┐│ 2 │ // └─┘│ │ // └───┘ - const westRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 1, 1); - const eastRect = Blockly.utils.Rect.createFromPoint(this.createCoord(2.5, 1), 2, 2); + const westRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 1), + 1, + 1, + ); + const eastRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(2.5, 1), + 2, + 2, + ); const doIntersectOneWay = westRect.intersects(eastRect); const doIntersectOtherWay = eastRect.intersects(westRect); - assert.isFalse(doIntersectOneWay, 'Western rect does not intersect with eastern rect'); - assert.isFalse(doIntersectOtherWay, 'Eastern rect does not intersect with western rect'); + assert.isFalse( + doIntersectOneWay, + 'Western rect does not intersect with eastern rect', + ); + assert.isFalse( + doIntersectOtherWay, + 'Eastern rect does not intersect with western rect', + ); }); - test('Small rect right of big rect', function() { + test('Small rect right of big rect', function () { // ┌───┐ // │ 2 │┌─┐ // │ │└─┘ // └───┘ - const westRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); - const eastRect = Blockly.utils.Rect.createFromPoint(this.createCoord(3.5, 1), 1, 1); + const westRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 1), + 2, + 2, + ); + const eastRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(3.5, 1), + 1, + 1, + ); const doIntersectOneWay = westRect.intersects(eastRect); const doIntersectOtherWay = eastRect.intersects(westRect); - assert.isFalse(doIntersectOneWay, 'Western rect does not intersect with eastern rect'); - assert.isFalse(doIntersectOtherWay, 'Eastern rect does not intersect with western rect'); + assert.isFalse( + doIntersectOneWay, + 'Western rect does not intersect with eastern rect', + ); + assert.isFalse( + doIntersectOtherWay, + 'Eastern rect does not intersect with western rect', + ); }); - test('Small rect above big rect', function() { + test('Small rect above big rect', function () { // ┌─┐ // └─┘ // ┌───┐ // │ 2 │ // └───┘ - const northRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 1, 1); - const southRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2.5), 2, 2); + const northRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 1), + 1, + 1, + ); + const southRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2.5), + 2, + 2, + ); const doIntersectOneWay = northRect.intersects(southRect); const doIntersectOtherWay = southRect.intersects(northRect); - assert.isFalse(doIntersectOneWay, 'Northern rect does not intersect with southern rect'); - assert.isFalse(doIntersectOtherWay, 'Southern rect does not intersect with northern rect'); + assert.isFalse( + doIntersectOneWay, + 'Northern rect does not intersect with southern rect', + ); + assert.isFalse( + doIntersectOtherWay, + 'Southern rect does not intersect with northern rect', + ); }); - test('Small rect below big rect', function() { + test('Small rect below big rect', function () { // ┌───┐ // │ 2 │ // └───┘ // ┌─┐ // └─┘ - const northRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); - const southRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 3.5), 1, 1); + const northRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 1), + 2, + 2, + ); + const southRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 3.5), + 1, + 1, + ); const doIntersectOneWay = northRect.intersects(southRect); const doIntersectOtherWay = southRect.intersects(northRect); - assert.isFalse(doIntersectOneWay, 'Northern rect does not intersect with southern rect'); - assert.isFalse(doIntersectOtherWay, 'Southern rect does not intersect with northern rect'); + assert.isFalse( + doIntersectOneWay, + 'Northern rect does not intersect with southern rect', + ); + assert.isFalse( + doIntersectOtherWay, + 'Southern rect does not intersect with northern rect', + ); }); - test('Same-size rects diagonal (NE and SW) to each other', function() { + test('Same-size rects diagonal (NE and SW) to each other', function () { // ┌───┐ // │ 2 │ // └───┘ // ┌───┐ // │ 2 │ // └───┘ - const neRect = Blockly.utils.Rect.createFromPoint(this.createCoord(3.5, 1), 2, 2); - const swRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 3.5), 2, 2); + const neRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(3.5, 1), + 2, + 2, + ); + const swRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 3.5), + 2, + 2, + ); const doIntersectOneWay = neRect.intersects(swRect); const doIntersectOtherWay = swRect.intersects(neRect); - assert.isFalse(doIntersectOneWay, 'NE rect does not intersect with SW rect'); - assert.isFalse(doIntersectOtherWay, 'SW rect does not intersect with NE rect'); + assert.isFalse( + doIntersectOneWay, + 'NE rect does not intersect with SW rect', + ); + assert.isFalse( + doIntersectOtherWay, + 'SW rect does not intersect with NE rect', + ); }); - test('Same-size rects diagonal (NW and SE) to each other', function() { + test('Same-size rects diagonal (NW and SE) to each other', function () { // ┌───┐ // │ 2 │ // └───┘ // ┌───┐ // │ 2 │ // └───┘ - const nwRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); - const seRect = Blockly.utils.Rect.createFromPoint(this.createCoord(3.5, 3.5), 2, 2); + const nwRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 1), + 2, + 2, + ); + const seRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(3.5, 3.5), + 2, + 2, + ); const doIntersectOneWay = nwRect.intersects(seRect); const doIntersectOtherWay = seRect.intersects(nwRect); - assert.isFalse(doIntersectOneWay, 'NW rect does not intersect with SE rect'); - assert.isFalse(doIntersectOtherWay, 'SE rect does not intersect with NW rect'); + assert.isFalse( + doIntersectOneWay, + 'NW rect does not intersect with SE rect', + ); + assert.isFalse( + doIntersectOtherWay, + 'SE rect does not intersect with NW rect', + ); }); - test('Small rect NE of big rect', function() { + test('Small rect NE of big rect', function () { // ┌─┐ // └─┘ // ┌───┐ // │ 2 │ // └───┘ - const neRect = Blockly.utils.Rect.createFromPoint(this.createCoord(3.5, 1), 1, 1); - const swRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 2.5), 2, 2); + const neRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(3.5, 1), + 1, + 1, + ); + const swRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 2.5), + 2, + 2, + ); const doIntersectOneWay = neRect.intersects(swRect); const doIntersectOtherWay = swRect.intersects(neRect); - assert.isFalse(doIntersectOneWay, 'NE rect does not intersect with SW rect'); - assert.isFalse(doIntersectOtherWay, 'SW rect does not intersect with NE rect'); + assert.isFalse( + doIntersectOneWay, + 'NE rect does not intersect with SW rect', + ); + assert.isFalse( + doIntersectOtherWay, + 'SW rect does not intersect with NE rect', + ); }); - test('Small rect NW of big rect', function() { + test('Small rect NW of big rect', function () { // ┌─┐ // └─┘ // ┌───┐ // │ 2 │ // └───┘ - const nwRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 1, 1); - const seRect = Blockly.utils.Rect.createFromPoint(this.createCoord(2.5, 2.5), 2, 2); + const nwRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 1), + 1, + 1, + ); + const seRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(2.5, 2.5), + 2, + 2, + ); const doIntersectOneWay = nwRect.intersects(seRect); const doIntersectOtherWay = seRect.intersects(nwRect); - assert.isFalse(doIntersectOneWay, 'NW rect does not intersect with SE rect'); - assert.isFalse(doIntersectOtherWay, 'SE rect does not intersect with NW rect'); + assert.isFalse( + doIntersectOneWay, + 'NW rect does not intersect with SE rect', + ); + assert.isFalse( + doIntersectOtherWay, + 'SE rect does not intersect with NW rect', + ); }); - test('Small rect SW of big rect', function() { + test('Small rect SW of big rect', function () { // ┌───┐ // │ 2 │ // └───┘ // ┌─┐ // └─┘ - const neRect = Blockly.utils.Rect.createFromPoint(this.createCoord(2.5, 1), 2, 2); - const swRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 3.5), 1, 1); + const neRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(2.5, 1), + 2, + 2, + ); + const swRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 3.5), + 1, + 1, + ); const doIntersectOneWay = neRect.intersects(swRect); const doIntersectOtherWay = swRect.intersects(neRect); - assert.isFalse(doIntersectOneWay, 'NE rect does not intersect with SW rect'); - assert.isFalse(doIntersectOtherWay, 'SW rect does not intersect with NE rect'); + assert.isFalse( + doIntersectOneWay, + 'NE rect does not intersect with SW rect', + ); + assert.isFalse( + doIntersectOtherWay, + 'SW rect does not intersect with NE rect', + ); }); - test('Small rect SE of big rect', function() { + test('Small rect SE of big rect', function () { // ┌───┐ // │ 2 │ // └───┘ // ┌─┐ // └─┘ - const nwRect = Blockly.utils.Rect.createFromPoint(this.createCoord(1, 1), 2, 2); - const seRect = Blockly.utils.Rect.createFromPoint(this.createCoord(3.5, 3.5), 1, 1); + const nwRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(1, 1), + 2, + 2, + ); + const seRect = Blockly.utils.Rect.createFromPoint( + this.createCoord(3.5, 3.5), + 1, + 1, + ); const doIntersectOneWay = nwRect.intersects(seRect); const doIntersectOtherWay = seRect.intersects(nwRect); - assert.isFalse(doIntersectOneWay, 'NW rect does not intersect with SE rect'); - assert.isFalse(doIntersectOtherWay, 'SE rect does not intersect with NW rect'); + assert.isFalse( + doIntersectOneWay, + 'NW rect does not intersect with SE rect', + ); + assert.isFalse( + doIntersectOtherWay, + 'SE rect does not intersect with NW rect', + ); }); }); }); diff --git a/tests/mocha/workspace_svg_test.js b/tests/mocha/workspace_svg_test.js index 9218ad22b..d90c21106 100644 --- a/tests/mocha/workspace_svg_test.js +++ b/tests/mocha/workspace_svg_test.js @@ -408,21 +408,21 @@ suite('WorkspaceSvg', function () { }); suite('tidyUp', function () { - test('empty workspace does not change', function() { + test('empty workspace does not change', function () { this.workspace.tidyUp(); const blocks = this.workspace.getTopBlocks(true); assert.equal(blocks.length, 0, 'workspace is empty'); }); - test('single block at (0, 0) does not change', function() { + test('single block at (0, 0) does not change', function () { const blockJson = { - "type": "math_number", - "x": 0, - "y": 0, - "fields": { - "NUM": 123 - } + 'type': 'math_number', + 'x': 0, + 'y': 0, + 'fields': { + 'NUM': 123, + }, }; Blockly.serialization.blocks.append(blockJson, this.workspace); @@ -431,17 +431,21 @@ suite('WorkspaceSvg', function () { const blocks = this.workspace.getTopBlocks(true); const origin = new Blockly.utils.Coordinate(0, 0); assert.equal(blocks.length, 1, 'workspace has one top-level block'); - assert.deepEqual(blocks[0].getRelativeToSurfaceXY(), origin, 'block is at origin'); + assert.deepEqual( + blocks[0].getRelativeToSurfaceXY(), + origin, + 'block is at origin', + ); }); - test('single block at (10, 15) is moved to (0, 0)', function() { + test('single block at (10, 15) is moved to (0, 0)', function () { const blockJson = { - "type": "math_number", - "x": 10, - "y": 15, - "fields": { - "NUM": 123 - } + 'type': 'math_number', + 'x': 10, + 'y': 15, + 'fields': { + 'NUM': 123, + }, }; Blockly.serialization.blocks.append(blockJson, this.workspace); @@ -452,26 +456,30 @@ suite('WorkspaceSvg', function () { const origin = new Blockly.utils.Coordinate(0, 0); assert.equal(topBlocks.length, 1, 'workspace has one top-level block'); assert.equal(allBlocks.length, 1, 'workspace has one block overall'); - assert.deepEqual(topBlocks[0].getRelativeToSurfaceXY(), origin, 'block is at origin'); + assert.deepEqual( + topBlocks[0].getRelativeToSurfaceXY(), + origin, + 'block is at origin', + ); }); - test('single block at (10, 15) with child is moved as unit to (0, 0)', function() { + test('single block at (10, 15) with child is moved as unit to (0, 0)', function () { const blockJson = { - "type": "logic_negate", - "id": "parent", - "x": 10, - "y": 15, - "inputs": { - "BOOL": { - "block": { - "type": "logic_boolean", - "id": "child", - "fields": { - "BOOL": "TRUE" - } - } - } - } + 'type': 'logic_negate', + 'id': 'parent', + 'x': 10, + 'y': 15, + 'inputs': { + 'BOOL': { + 'block': { + 'type': 'logic_boolean', + 'id': 'child', + 'fields': { + 'BOOL': 'TRUE', + }, + }, + }, + }, }; Blockly.serialization.blocks.append(blockJson, this.workspace); @@ -482,21 +490,29 @@ suite('WorkspaceSvg', function () { const origin = new Blockly.utils.Coordinate(0, 0); assert.equal(topBlocks.length, 1, 'workspace has one top-level block'); assert.equal(allBlocks.length, 2, 'workspace has two blocks overall'); - assert.deepEqual(topBlocks[0].getRelativeToSurfaceXY(), origin, 'block is at origin'); - assert.notDeepEqual(allBlocks[1].getRelativeToSurfaceXY(), origin, 'child is not at origin'); + assert.deepEqual( + topBlocks[0].getRelativeToSurfaceXY(), + origin, + 'block is at origin', + ); + assert.notDeepEqual( + allBlocks[1].getRelativeToSurfaceXY(), + origin, + 'child is not at origin', + ); }); - test('two blocks first at (10, 15) second at (0, 0) do not switch places', function() { + test('two blocks first at (10, 15) second at (0, 0) do not switch places', function () { const blockJson1 = { - "type": "math_number", - "id": "block1", - "x": 10, - "y": 15, - "fields": { - "NUM": 123 - } + 'type': 'math_number', + 'id': 'block1', + 'x': 10, + 'y': 15, + 'fields': { + 'NUM': 123, + }, }; - const blockJson2 = {...blockJson1, "id": "block2", "x": 0, "y": 0}; + const blockJson2 = {...blockJson1, 'id': 'block2', 'x': 0, 'y': 0}; Blockly.serialization.blocks.append(blockJson1, this.workspace); Blockly.serialization.blocks.append(blockJson2, this.workspace); @@ -510,21 +526,34 @@ suite('WorkspaceSvg', function () { const origin = new Blockly.utils.Coordinate(0, 0); const belowBlock2 = new Blockly.utils.Coordinate(0, 50); assert.equal(topBlocks.length, 2, 'workspace has two top-level blocks'); - assert.deepEqual(block2.getRelativeToSurfaceXY(), origin, 'block2 is at origin'); - assert.deepEqual(block1.getRelativeToSurfaceXY(), belowBlock2, 'block1 is below block2'); + assert.deepEqual( + block2.getRelativeToSurfaceXY(), + origin, + 'block2 is at origin', + ); + assert.deepEqual( + block1.getRelativeToSurfaceXY(), + belowBlock2, + 'block1 is below block2', + ); }); - test('two overlapping blocks are moved to origin and below', function() { + test('two overlapping blocks are moved to origin and below', function () { const blockJson1 = { - "type": "math_number", - "id": "block1", - "x": 25, - "y": 15, - "fields": { - "NUM": 123 - } + 'type': 'math_number', + 'id': 'block1', + 'x': 25, + 'y': 15, + 'fields': { + 'NUM': 123, + }, + }; + const blockJson2 = { + ...blockJson1, + 'id': 'block2', + 'x': 15.25, + 'y': 20.25, }; - const blockJson2 = {...blockJson1, "id": "block2", "x": 15.25, "y": 20.25}; Blockly.serialization.blocks.append(blockJson1, this.workspace); Blockly.serialization.blocks.append(blockJson2, this.workspace); @@ -536,21 +565,34 @@ suite('WorkspaceSvg', function () { const origin = new Blockly.utils.Coordinate(0, 0); const belowBlock1 = new Blockly.utils.Coordinate(0, 50); assert.equal(topBlocks.length, 2, 'workspace has two top-level blocks'); - assert.deepEqual(block1.getRelativeToSurfaceXY(), origin, 'block1 is at origin'); - assert.deepEqual(block2.getRelativeToSurfaceXY(), belowBlock1, 'block2 is below block1'); + assert.deepEqual( + block1.getRelativeToSurfaceXY(), + origin, + 'block1 is at origin', + ); + assert.deepEqual( + block2.getRelativeToSurfaceXY(), + belowBlock1, + 'block2 is below block1', + ); }); - test('two overlapping blocks with snapping are moved to grid-aligned positions', function() { + test('two overlapping blocks with snapping are moved to grid-aligned positions', function () { const blockJson1 = { - "type": "math_number", - "id": "block1", - "x": 25, - "y": 15, - "fields": { - "NUM": 123 - } + 'type': 'math_number', + 'id': 'block1', + 'x': 25, + 'y': 15, + 'fields': { + 'NUM': 123, + }, + }; + const blockJson2 = { + ...blockJson1, + 'id': 'block2', + 'x': 15.25, + 'y': 20.25, }; - const blockJson2 = {...blockJson1, "id": "block2", "x": 15.25, "y": 20.25}; Blockly.serialization.blocks.append(blockJson1, this.workspace); Blockly.serialization.blocks.append(blockJson2, this.workspace); this.workspace.getGrid().setSpacing(20); @@ -564,28 +606,41 @@ suite('WorkspaceSvg', function () { const snappedOffOrigin = new Blockly.utils.Coordinate(10, 10); const belowBlock1 = new Blockly.utils.Coordinate(10, 70); assert.equal(topBlocks.length, 2, 'workspace has two top-level blocks'); - assert.deepEqual(block1.getRelativeToSurfaceXY(), snappedOffOrigin, 'block1 is near origin'); - assert.deepEqual(block2.getRelativeToSurfaceXY(), belowBlock1, 'block2 is below block1'); + assert.deepEqual( + block1.getRelativeToSurfaceXY(), + snappedOffOrigin, + 'block1 is near origin', + ); + assert.deepEqual( + block2.getRelativeToSurfaceXY(), + belowBlock1, + 'block2 is below block1', + ); }); - test('two overlapping blocks are moved to origin and below including children', function() { + test('two overlapping blocks are moved to origin and below including children', function () { const blockJson1 = { - "type": "logic_negate", - "id": "block1", - "x": 10, - "y": 15, - "inputs": { - "BOOL": { - "block": { - "type": "logic_boolean", - "fields": { - "BOOL": "TRUE" - } - } - } - } + 'type': 'logic_negate', + 'id': 'block1', + 'x': 10, + 'y': 15, + 'inputs': { + 'BOOL': { + 'block': { + 'type': 'logic_boolean', + 'fields': { + 'BOOL': 'TRUE', + }, + }, + }, + }, + }; + const blockJson2 = { + ...blockJson1, + 'id': 'block2', + 'x': 15.25, + 'y': 20.25, }; - const blockJson2 = {...blockJson1, "id": "block2", "x": 15.25, "y": 20.25}; Blockly.serialization.blocks.append(blockJson1, this.workspace); Blockly.serialization.blocks.append(blockJson2, this.workspace); @@ -605,60 +660,76 @@ suite('WorkspaceSvg', function () { assert.equal(allBlocks.length, 4, 'workspace has four blocks overall'); assert.deepEqual(block1Pos, origin, 'block1 is at origin'); assert.deepEqual(block2Pos, belowBlock1, 'block2 is below block1'); - assert.isAbove(block1ChildPos.x, block1Pos.x, 'block1\'s child is right of it'); - assert.isBelow(block1ChildPos.y, block2Pos.y, 'block1\'s child is above block 2'); - assert.isAbove(block2ChildPos.x, block2Pos.x, 'block2\'s child is right of it'); - assert.isAbove(block2ChildPos.y, block1Pos.y, 'block2\'s child is below block 1'); + assert.isAbove( + block1ChildPos.x, + block1Pos.x, + "block1's child is right of it", + ); + assert.isBelow( + block1ChildPos.y, + block2Pos.y, + "block1's child is above block 2", + ); + assert.isAbove( + block2ChildPos.x, + block2Pos.x, + "block2's child is right of it", + ); + assert.isAbove( + block2ChildPos.y, + block1Pos.y, + "block2's child is below block 1", + ); }); - test('two large overlapping blocks are moved to origin and below', function() { + test('two large overlapping blocks are moved to origin and below', function () { const blockJson1 = { - "type": "controls_repeat_ext", - "id": "block1", - "x": 10, - "y": 20, - "inputs": { - "TIMES": { - "shadow": { - "type": "math_number", - "fields": { - "NUM": 10 - } - } + 'type': 'controls_repeat_ext', + 'id': 'block1', + 'x': 10, + 'y': 20, + 'inputs': { + 'TIMES': { + 'shadow': { + 'type': 'math_number', + 'fields': { + 'NUM': 10, + }, + }, }, - "DO": { - "block": { - "type": "controls_if", - "inputs": { - "IF0": { - "block": { - "type": "logic_boolean", - "fields": { - "BOOL": "TRUE" - } - } + 'DO': { + 'block': { + 'type': 'controls_if', + 'inputs': { + 'IF0': { + 'block': { + 'type': 'logic_boolean', + 'fields': { + 'BOOL': 'TRUE', + }, + }, }, - "DO0": { - "block": { - "type": "text_print", - "inputs": { - "TEXT": { - "shadow": { - "type": "text", - "fields": { - "TEXT": "abc" - } - } - } - } - } - } - } - } - } - } + 'DO0': { + 'block': { + 'type': 'text_print', + 'inputs': { + 'TEXT': { + 'shadow': { + 'type': 'text', + 'fields': { + 'TEXT': 'abc', + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, }; - const blockJson2 = {...blockJson1, "id": "block2", "x": 20, "y": 30}; + const blockJson2 = {...blockJson1, 'id': 'block2', 'x': 20, 'y': 30}; Blockly.serialization.blocks.append(blockJson1, this.workspace); Blockly.serialization.blocks.append(blockJson2, this.workspace); @@ -670,24 +741,32 @@ suite('WorkspaceSvg', function () { const origin = new Blockly.utils.Coordinate(0, 0); const belowBlock1 = new Blockly.utils.Coordinate(0, 144); assert.equal(topBlocks.length, 2, 'workspace has two top-level blocks'); - assert.deepEqual(block1.getRelativeToSurfaceXY(), origin, 'block1 is at origin'); - assert.deepEqual(block2.getRelativeToSurfaceXY(), belowBlock1, 'block2 is below block1'); + assert.deepEqual( + block1.getRelativeToSurfaceXY(), + origin, + 'block1 is at origin', + ); + assert.deepEqual( + block2.getRelativeToSurfaceXY(), + belowBlock1, + 'block2 is below block1', + ); }); - test('five overlapping blocks are moved in-order as one column', function() { + test('five overlapping blocks are moved in-order as one column', function () { const blockJson1 = { - "type": "math_number", - "id": "block1", - "x": 1, - "y": 2, - "fields": { - "NUM": 123 - } + 'type': 'math_number', + 'id': 'block1', + 'x': 1, + 'y': 2, + 'fields': { + 'NUM': 123, + }, }; - const blockJson2 = {...blockJson1, "id": "block2", "x": 3, "y": 4}; - const blockJson3 = {...blockJson1, "id": "block3", "x": 5, "y": 6}; - const blockJson4 = {...blockJson1, "id": "block4", "x": 7, "y": 8}; - const blockJson5 = {...blockJson1, "id": "block5", "x": 9, "y": 10}; + const blockJson2 = {...blockJson1, 'id': 'block2', 'x': 3, 'y': 4}; + const blockJson3 = {...blockJson1, 'id': 'block3', 'x': 5, 'y': 6}; + const blockJson4 = {...blockJson1, 'id': 'block4', 'x': 7, 'y': 8}; + const blockJson5 = {...blockJson1, 'id': 'block5', 'x': 9, 'y': 10}; Blockly.serialization.blocks.append(blockJson1, this.workspace); Blockly.serialization.blocks.append(blockJson2, this.workspace); Blockly.serialization.blocks.append(blockJson3, this.workspace); @@ -697,11 +776,21 @@ suite('WorkspaceSvg', function () { this.workspace.tidyUp(); const topBlocks = this.workspace.getTopBlocks(true); - const block1Pos = this.workspace.getBlockById('block1').getRelativeToSurfaceXY(); - const block2Pos = this.workspace.getBlockById('block2').getRelativeToSurfaceXY(); - const block3Pos = this.workspace.getBlockById('block3').getRelativeToSurfaceXY(); - const block4Pos = this.workspace.getBlockById('block4').getRelativeToSurfaceXY(); - const block5Pos = this.workspace.getBlockById('block5').getRelativeToSurfaceXY(); + const block1Pos = this.workspace + .getBlockById('block1') + .getRelativeToSurfaceXY(); + const block2Pos = this.workspace + .getBlockById('block2') + .getRelativeToSurfaceXY(); + const block3Pos = this.workspace + .getBlockById('block3') + .getRelativeToSurfaceXY(); + const block4Pos = this.workspace + .getBlockById('block4') + .getRelativeToSurfaceXY(); + const block5Pos = this.workspace + .getBlockById('block5') + .getRelativeToSurfaceXY(); const origin = new Blockly.utils.Coordinate(0, 0); assert.equal(topBlocks.length, 5, 'workspace has five top-level blocks'); assert.deepEqual(block1Pos, origin, 'block1 is at origin'); @@ -715,15 +804,15 @@ suite('WorkspaceSvg', function () { assert.isAbove(block5Pos.y, block4Pos.y, 'block5 is below block4'); }); - test('single immovable block at (10, 15) is not moved', function() { + test('single immovable block at (10, 15) is not moved', function () { const blockJson = { - "type": "math_number", - "x": 10, - "y": 15, - "movable": false, - "fields": { - "NUM": 123 - } + 'type': 'math_number', + 'x': 10, + 'y': 15, + 'movable': false, + 'fields': { + 'NUM': 123, + }, }; Blockly.serialization.blocks.append(blockJson, this.workspace); @@ -734,68 +823,84 @@ suite('WorkspaceSvg', function () { const origPos = new Blockly.utils.Coordinate(10, 15); assert.equal(topBlocks.length, 1, 'workspace has one top-level block'); assert.equal(allBlocks.length, 1, 'workspace has one block overall'); - assert.deepEqual(topBlocks[0].getRelativeToSurfaceXY(), origPos, 'block is at (10, 15)'); + assert.deepEqual( + topBlocks[0].getRelativeToSurfaceXY(), + origPos, + 'block is at (10, 15)', + ); }); - test('multiple block types immovable blocks are not moved', function() { + test('multiple block types immovable blocks are not moved', function () { const smallBlockJson = { - "type": "math_number", - "fields": { - "NUM": 123 - } + 'type': 'math_number', + 'fields': { + 'NUM': 123, + }, }; const largeBlockJson = { - "type": "controls_repeat_ext", - "inputs": { - "TIMES": { - "shadow": { - "type": "math_number", - "fields": { - "NUM": 10 - } - } + 'type': 'controls_repeat_ext', + 'inputs': { + 'TIMES': { + 'shadow': { + 'type': 'math_number', + 'fields': { + 'NUM': 10, + }, + }, }, - "DO": { - "block": { - "type": "controls_if", - "inputs": { - "IF0": { - "block": { - "type": "logic_boolean", - "fields": { - "BOOL": "TRUE" - } - } + 'DO': { + 'block': { + 'type': 'controls_if', + 'inputs': { + 'IF0': { + 'block': { + 'type': 'logic_boolean', + 'fields': { + 'BOOL': 'TRUE', + }, + }, }, - "DO0": { - "block": { - "type": "text_print", - "inputs": { - "TEXT": { - "shadow": { - "type": "text", - "fields": { - "TEXT": "abc" - } - } - } - } - } - } - } - } - } - } + 'DO0': { + 'block': { + 'type': 'text_print', + 'inputs': { + 'TEXT': { + 'shadow': { + 'type': 'text', + 'fields': { + 'TEXT': 'abc', + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, }; // Block 1 overlaps block 2 (immovable) from above. - const blockJson1 = {...smallBlockJson, "id": "block1", "x": 1, "y": 2}; - const blockJson2 = {...smallBlockJson, "id": "block2", "x": 10, "y": 20, "movable": false}; + const blockJson1 = {...smallBlockJson, 'id': 'block1', 'x': 1, 'y': 2}; + const blockJson2 = { + ...smallBlockJson, + 'id': 'block2', + 'x': 10, + 'y': 20, + 'movable': false, + }; // Block 3 overlaps block 2 (immovable) from below. - const blockJson3 = {...smallBlockJson, "id": "block3", "x": 2, "y": 30}; - const blockJson4 = {...largeBlockJson, "id": "block4", "x": 3, "y": 40}; + const blockJson3 = {...smallBlockJson, 'id': 'block3', 'x': 2, 'y': 30}; + const blockJson4 = {...largeBlockJson, 'id': 'block4', 'x': 3, 'y': 40}; // Block 5 (immovable) will end up overlapping with block 4 since it's large and will be // moved. - const blockJson5 = {...smallBlockJson, "id": "block5", "x": 20, "y": 200, "movable": false}; + const blockJson5 = { + ...smallBlockJson, + 'id': 'block5', + 'x': 20, + 'y': 200, + 'movable': false, + }; Blockly.serialization.blocks.append(blockJson1, this.workspace); Blockly.serialization.blocks.append(blockJson2, this.workspace); Blockly.serialization.blocks.append(blockJson3, this.workspace); @@ -805,11 +910,21 @@ suite('WorkspaceSvg', function () { this.workspace.tidyUp(); const topBlocks = this.workspace.getTopBlocks(true); - const block1Rect = this.workspace.getBlockById('block1').getBoundingRectangle(); - const block2Rect = this.workspace.getBlockById('block2').getBoundingRectangle(); - const block3Rect = this.workspace.getBlockById('block3').getBoundingRectangle(); - const block4Rect = this.workspace.getBlockById('block4').getBoundingRectangle(); - const block5Rect = this.workspace.getBlockById('block5').getBoundingRectangle(); + const block1Rect = this.workspace + .getBlockById('block1') + .getBoundingRectangle(); + const block2Rect = this.workspace + .getBlockById('block2') + .getBoundingRectangle(); + const block3Rect = this.workspace + .getBlockById('block3') + .getBoundingRectangle(); + const block4Rect = this.workspace + .getBlockById('block4') + .getBoundingRectangle(); + const block5Rect = this.workspace + .getBlockById('block5') + .getBoundingRectangle(); assert.equal(topBlocks.length, 5, 'workspace has five top-level blocks'); // Check that immovable blocks haven't moved. assert.equal(block2Rect.left, 10, 'block2.x is at 10'); @@ -826,10 +941,22 @@ suite('WorkspaceSvg', function () { assert.isAbove(block5Rect.top, block3Rect.top, 'block5 is below block3'); assert.isAbove(block4Rect.top, block5Rect.top, 'block4 is below block5'); // Ensure no blocks intersect (can check in order due to the position verification above). - assert.isFalse(block2Rect.intersects(block1Rect), "block2/block1 do not intersect"); - assert.isFalse(block1Rect.intersects(block3Rect), "block1/block3 do not intersect"); - assert.isFalse(block3Rect.intersects(block5Rect), "block3/block5 do not intersect"); - assert.isFalse(block5Rect.intersects(block4Rect), "block5/block4 do not intersect"); + assert.isFalse( + block2Rect.intersects(block1Rect), + 'block2/block1 do not intersect', + ); + assert.isFalse( + block1Rect.intersects(block3Rect), + 'block1/block3 do not intersect', + ); + assert.isFalse( + block3Rect.intersects(block5Rect), + 'block3/block5 do not intersect', + ); + assert.isFalse( + block5Rect.intersects(block4Rect), + 'block5/block4 do not intersect', + ); }); }); From 348a5b33b8692d15b16220f06f6c85eb569b3b28 Mon Sep 17 00:00:00 2001 From: Ben Henning Date: Thu, 22 Aug 2024 18:00:22 +0000 Subject: [PATCH 35/90] Addressed self-review comment. --- tests/mocha/rect_test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/mocha/rect_test.js b/tests/mocha/rect_test.js index 796e7ec87..37712dff3 100644 --- a/tests/mocha/rect_test.js +++ b/tests/mocha/rect_test.js @@ -119,7 +119,7 @@ suite('Rect', function () { assert.isTrue(areEqual, 'an instance and its clone should be equal'); }); - test('object should equal its clone', function () { + test('object should equal an exact explicit copy', function () { const rect1 = Blockly.utils.Rect.createFromPoint( this.createCoord(1, 2), 23, From 095f29e2742ace7fb87fa1ed814d4fe86dce4358 Mon Sep 17 00:00:00 2001 From: John Nesky Date: Mon, 26 Aug 2024 12:22:37 -0700 Subject: [PATCH 36/90] fix: Detect if deleting shadow block affects selection highlight (#8533) * fix: Detect if deleting shadow block affects selection highlight * Use contains instead of descendsFrom for html consistency. * Added tests. * Removing and manually inlining new contains function. --- core/block_svg.ts | 21 ++++++++++++++++++++- tests/mocha/block_test.js | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/core/block_svg.ts b/core/block_svg.ts index db75acde2..9797a50e7 100644 --- a/core/block_svg.ts +++ b/core/block_svg.ts @@ -279,7 +279,7 @@ export class BlockSvg this.addSelect(); } - /** Unselects this block. Unhighlights the blockv visually. */ + /** Unselects this block. Unhighlights the block visually. */ unselect() { if (this.isShadow()) { this.getParent()?.unselect(); @@ -797,6 +797,25 @@ export class BlockSvg blockAnimations.disposeUiEffect(this); } + // Selecting a shadow block highlights an ancestor block, but that highlight + // should be removed if the shadow block will be deleted. So, before + // deleting blocks and severing the connections between them, check whether + // doing so would delete a selected block and make sure that any associated + // parent is updated. + const selection = common.getSelected(); + if (selection instanceof Block) { + let selectionAncestor: Block | null = selection; + while (selectionAncestor !== null) { + if (selectionAncestor === this) { + // The block to be deleted contains the selected block, so remove any + // selection highlight associated with the selected block before + // deleting them. + selection.unselect(); + } + selectionAncestor = selectionAncestor.getParent(); + } + } + super.dispose(!!healStack); dom.removeNode(this.svgGroup_); } diff --git a/tests/mocha/block_test.js b/tests/mocha/block_test.js index 061584401..3f0eba44b 100644 --- a/tests/mocha/block_test.js +++ b/tests/mocha/block_test.js @@ -4,6 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ +import * as common from '../../build/src/core/common.js'; import {ConnectionType} from '../../build/src/core/connection_type.js'; import {EventType} from '../../build/src/core/events/type.js'; import * as eventUtils from '../../build/src/core/events/utils.js'; @@ -444,6 +445,39 @@ suite('Blocks', function () { }); }); }); + + suite('Disposing selected shadow block', function () { + setup(function () { + this.workspace = Blockly.inject('blocklyDiv'); + this.parentBlock = this.workspace.newBlock('row_block'); + this.parentBlock.initSvg(); + this.parentBlock.render(); + this.parentBlock.inputList[0].connection.setShadowState({ + 'type': 'row_block', + 'id': 'shadow_child', + }); + this.shadowChild = + this.parentBlock.inputList[0].connection.targetConnection.getSourceBlock(); + }); + + teardown(function () { + workspaceTeardown.call(this, this.workspace); + }); + + test('Disposing selected shadow unhighlights parent', function () { + const parentBlock = this.parentBlock; + common.setSelected(this.shadowChild); + assert.isTrue( + parentBlock.pathObject.svgRoot.classList.contains('blocklySelected'), + 'Expected parent to be highlighted after selecting shadow child', + ); + this.shadowChild.dispose(); + assert.isFalse( + parentBlock.pathObject.svgRoot.classList.contains('blocklySelected'), + 'Expected parent to be unhighlighted after deleting shadow child', + ); + }); + }); }); suite('Remove Input', function () { From 07da975b63ce43e894c180222f535b158009ac5e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 16:28:15 -0700 Subject: [PATCH 37/90] chore(deps): bump @typescript-eslint/parser from 8.1.0 to 8.2.0 (#8552) Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 8.1.0 to 8.2.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.2.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 122 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 109 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7097ad6d1..7d4ed8abc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1336,16 +1336,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.1.0.tgz", - "integrity": "sha512-U7iTAtGgJk6DPX9wIWPPOlt1gO57097G06gIcl0N0EEnNw8RGD62c+2/DiP/zL7KrkqnnqF7gtFGR7YgzPllTA==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.2.0.tgz", + "integrity": "sha512-j3Di+o0lHgPrb7FxL3fdEy6LJ/j2NE8u+AP/5cQ9SKb+JLH6V6UHDqJ+e0hXBkHP1wn1YDFjYCS9LBQsZDlDEg==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/scope-manager": "8.1.0", - "@typescript-eslint/types": "8.1.0", - "@typescript-eslint/typescript-estree": "8.1.0", - "@typescript-eslint/visitor-keys": "8.1.0", + "@typescript-eslint/scope-manager": "8.2.0", + "@typescript-eslint/types": "8.2.0", + "@typescript-eslint/typescript-estree": "8.2.0", + "@typescript-eslint/visitor-keys": "8.2.0", "debug": "^4.3.4" }, "engines": { @@ -1364,12 +1363,15 @@ } } }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.1.0.tgz", - "integrity": "sha512-q2/Bxa0gMOu/2/AKALI0tCKbG2zppccnRIRCW6BaaTlRVaPKft4oVYPp7WOPpcnsgbr0qROAVCVKCvIQ0tbWog==", + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.2.0.tgz", + "integrity": "sha512-OFn80B38yD6WwpoHU2Tz/fTz7CgFqInllBoC3WP+/jLbTb4gGPTy9HBSTsbDWkMdN55XlVU0mMDYAtgvlUspGw==", "dev": true, - "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.2.0", + "@typescript-eslint/visitor-keys": "8.2.0" + }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -1378,6 +1380,100 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.2.0.tgz", + "integrity": "sha512-6a9QSK396YqmiBKPkJtxsgZZZVjYQ6wQ/TlI0C65z7vInaETuC6HAHD98AGLC8DyIPqHytvNuS8bBVvNLKyqvQ==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.2.0.tgz", + "integrity": "sha512-kiG4EDUT4dImplOsbh47B1QnNmXSoUqOjWDvCJw/o8LgfD0yr7k2uy54D5Wm0j4t71Ge1NkynGhpWdS0dEIAUA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "8.2.0", + "@typescript-eslint/visitor-keys": "8.2.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.2.0.tgz", + "integrity": "sha512-sbgsPMW9yLvS7IhCi8IpuK1oBmtbWUNP+hBdwl/I9nzqVsszGnNGti5r9dUtF5RLivHUFFIdRvLiTsPhzSyJ3Q==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "8.2.0", + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@typescript-eslint/scope-manager": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.1.0.tgz", From a7afda8343a7bb74819f3557e81774d344311161 Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Thu, 29 Aug 2024 17:41:54 +0100 Subject: [PATCH 38/90] fix(events): Simplify `filter` function, add new `enqueueEvent` function (#8539) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs(events): JSDoc improvments * fix(filter): Introduce enqueueEvent; don't reorder in filter Remove the broken BlockChange event reordering code from filter. Instead, do necessary event reordering (correctly, this time) in a new enqueueEvent function used by fireInternal. * chore(events): Deprecate forward parameter of filter Since we don't filter in undo any more, and filtering in reverse order causes problems, prepare to remove this opportunity for error. * fix(events): Only merge adjacent events Simplify filter by having it consider only adjacent events in the queue for merging. Previously any events in the queue could potentially be merged if they were of suitable (typically identical) .type, even if other events had occurred between them (with the sole exception of BlockMove events, which would only be merged with adjacent events). This could potentially result in replay failures during undo/redo/mirroring, though it is unknown whether any such problems occurred in practice. * refactor(events): Tweaks - Use for…of loop where appropriate. - Make filter reason-merging code more concise. - Use arrow functions when calling Array.prototype.filter. * chore(events): Fix typos for PR #8539. --- core/events/utils.ts | 226 +++++++++++++++++++++++--------------- tests/mocha/event_test.js | 179 ++++++++++++++++++++++++++++++ 2 files changed, 316 insertions(+), 89 deletions(-) diff --git a/core/events/utils.ts b/core/events/utils.ts index 63217168f..7a2aca8ad 100644 --- a/core/events/utils.ts +++ b/core/events/utils.ts @@ -9,6 +9,7 @@ import type {Block} from '../block.js'; import * as common from '../common.js'; import * as registry from '../registry.js'; +import * as deprecation from '../utils/deprecation.js'; import * as idGenerator from '../utils/idgenerator.js'; import type {Workspace} from '../workspace.js'; import type {WorkspaceSvg} from '../workspace_svg.js'; @@ -26,7 +27,6 @@ import { isClick, isViewportChange, } from './predicates.js'; -import {EventType} from './type.js'; /** Group ID for new events. Grouped events are indivisible. */ let group = ''; @@ -79,9 +79,20 @@ export type BumpEvent = const FIRE_QUEUE: Abstract[] = []; /** - * Create a custom event and fire it. + * Enqueue an event to be dispatched to change listeners. * - * @param event Custom data for event. + * Notes: + * + * - Events are enqueued until a timeout, generally after rendering is + * complete or at the end of the current microtask, if not running + * in a browser. + * - Queued events are subject to destructive modification by being + * combined with later-enqueued events, but only until they are + * fired. + * - Events are dispatched via the fireChangeListener method on the + * affected workspace. + * + * @param event Any Blockly event. */ export function fire(event: Abstract) { TEST_ONLY.fireInternal(event); @@ -108,14 +119,14 @@ function fireInternal(event: Abstract) { setTimeout(fireNow, 0); } } - FIRE_QUEUE.push(event); + enqueueEvent(event); } /** Dispatch all queued events. */ function fireNow() { const queue = filter(FIRE_QUEUE, true); FIRE_QUEUE.length = 0; - for (let i = 0, event; (event = queue[i]); i++) { + for (const event of queue) { if (!event.workspaceId) { continue; } @@ -126,6 +137,46 @@ function fireNow() { } } +/** + * Enqueue an event on FIRE_QUEUE. + * + * Normally this is equivalent to FIRE_QUEUE.push(event), but if the + * enqueued event is a BlockChange event and the most recent event(s) + * on the queue are BlockMove events that (re)connect other blocks to + * the changed block (and belong to the same event group) then the + * enqueued event will be enqueued before those events rather than + * after. + * + * This is a workaround for a problem caused by the fact that + * MutatorIcon.prototype.recomposeSourceBlock can only fire a + * BlockChange event after the mutating block's compose method + * returns, meaning that if the compose method reconnects child blocks + * the corresponding BlockMove events are emitted _before_ the + * BlockChange event, causing issues with undo, mirroring, etc.; see + * https://github.com/google/blockly/issues/8225#issuecomment-2195751783 + * (and following) for details. + */ +function enqueueEvent(event: Abstract) { + if (isBlockChange(event) && event.element === 'mutation') { + let i; + for (i = FIRE_QUEUE.length; i > 0; i--) { + const otherEvent = FIRE_QUEUE[i - 1]; + if ( + otherEvent.group !== event.group || + otherEvent.workspaceId !== event.workspaceId || + !isBlockMove(otherEvent) || + otherEvent.newParentId !== event.blockId + ) { + break; + } + } + FIRE_QUEUE.splice(i, 0, event); + return; + } + + FIRE_QUEUE.push(event); +} + /** * Filter the queued events by merging duplicates, removing null * events and reording BlockChange events. @@ -151,107 +202,103 @@ function fireNow() { * https://github.com/google/blockly/issues/2037#issuecomment-2209696351 * * Later, in PR #1205 the original O(n^2) implementation was replaced - * by a linear-time implementation, though addiitonal fixes were made + * by a linear-time implementation, though additonal fixes were made * subsequently. * - * This function was previously called from Workspace.prototype.undo, - * but this was the cause of issue #7026, the originally-chosen fix - * for which was the addition (in PR #7069) of code to fireNow to - * post-filter the .undoStack_ and .redoStack_ of any workspace that - * had just been involved in dispatching events. This apparently - * resolved the issue but added considerable additional complexity and - * made it difficlut to reason about how events are processed for - * undo/redo, so both the call from undo and the post-processing code - * was later removed. + * In August 2024 a number of significant simplifications were made: * - * @param queueIn Array of events. + * This function was previously called from Workspace.prototype.undo, + * but the mutation of events by this function was the cause of issue + * #7026 (note that events would combine differently in reverse order + * vs. forward order). The originally-chosen fix for this was the + * addition (in PR #7069) of code to fireNow to post-filter the + * .undoStack_ and .redoStack_ of any workspace that had just been + * involved in dispatching events; this apparently resolved the issue + * but added considerable additional complexity and made it difficult + * to reason about how events are processed for undo/redo, so both the + * call from undo and the post-processing code was removed, and + * forward=true was made the default while calling the function with + * forward=false was deprecated. + * + * At the same time, the buggy code to reorder BlockChange events was + * replaced by a less-buggy version of the same functionality in a new + * function, enqueueEvent, called from fireInternal, thus assuring + * that events will be in the correct order at the time filter is + * called. + * + * Additionally, the event merging code was modified so that only + * immediately adjacent events would be merged. This simplified the + * implementation while ensuring that the merging of events cannot + * cause them to be reordered. + * + * @param queue Array of events. * @param forward True if forward (redo), false if backward (undo). + * This parameter is deprecated: true is now the default and + * calling filter with it set to false will in future not be + * supported. * @returns Array of filtered events. */ -export function filter(queueIn: Abstract[], forward: boolean): Abstract[] { - let queue = queueIn.slice(); - // Shallow copy of queue. +export function filter(queue: Abstract[], forward = true): Abstract[] { if (!forward) { - // Undo is merged in reverse order. - queue.reverse(); + deprecation.warn('filter(queue, /*forward=*/false)', 'v11.2', 'v12'); + // Undo was merged in reverse order. + queue = queue.slice().reverse(); // Copy before reversing in place. } - const mergedQueue = []; - const hash = Object.create(null); + const mergedQueue: Abstract[] = []; // Merge duplicates. - for (let i = 0, event; (event = queue[i]); i++) { - if (!event.isNull()) { - // Treat all UI events as the same type in hash table. - const eventType = event.isUiEvent ? EventType.UI : event.type; - // TODO(#5927): Check whether `blockId` exists before accessing it. - const blockId = (event as AnyDuringMigration).blockId; - const key = [eventType, blockId, event.workspaceId].join(' '); - - const lastEntry = hash[key]; - const lastEvent = lastEntry ? lastEntry.event : null; - if (!lastEntry) { - // Each item in the hash table has the event and the index of that event - // in the input array. This lets us make sure we only merge adjacent - // move events. - hash[key] = {event, index: i}; - mergedQueue.push(event); - } else if (isBlockMove(event) && lastEntry.index === i - 1) { - // Merge move events. - lastEvent.newParentId = event.newParentId; - lastEvent.newInputName = event.newInputName; - lastEvent.newCoordinate = event.newCoordinate; - if (event.reason) { - if (lastEvent.reason) { - // Concatenate reasons without duplicates. - const reasonSet = new Set(event.reason.concat(lastEvent.reason)); - lastEvent.reason = Array.from(reasonSet); - } else { - lastEvent.reason = event.reason; - } - } - lastEntry.index = i; - } else if ( - isBlockChange(event) && - event.element === lastEvent.element && - event.name === lastEvent.name - ) { - // Merge change events. - lastEvent.newValue = event.newValue; - } else if (isViewportChange(event)) { - // Merge viewport change events. - lastEvent.viewTop = event.viewTop; - lastEvent.viewLeft = event.viewLeft; - lastEvent.scale = event.scale; - lastEvent.oldScale = event.oldScale; - } else if (isClick(event) && isBubbleOpen(lastEvent)) { - // Drop click events caused by opening/closing bubbles. - } else { - // Collision: newer events should merge into this event to maintain - // order. - hash[key] = {event, index: i}; - mergedQueue.push(event); + for (const event of queue) { + const lastEvent = mergedQueue[mergedQueue.length - 1]; + if (event.isNull()) continue; + if ( + !lastEvent || + lastEvent.workspaceId !== event.workspaceId || + lastEvent.group !== event.group + ) { + mergedQueue.push(event); + continue; + } + if ( + isBlockMove(event) && + isBlockMove(lastEvent) && + event.blockId === lastEvent.blockId + ) { + // Merge move events. + lastEvent.newParentId = event.newParentId; + lastEvent.newInputName = event.newInputName; + lastEvent.newCoordinate = event.newCoordinate; + // Concatenate reasons without duplicates. + if (lastEvent.reason || event.reason) { + lastEvent.reason = Array.from( + new Set((lastEvent.reason ?? []).concat(event.reason ?? [])), + ); } + } else if ( + isBlockChange(event) && + isBlockChange(lastEvent) && + event.blockId === lastEvent.blockId && + event.element === lastEvent.element && + event.name === lastEvent.name + ) { + // Merge change events. + lastEvent.newValue = event.newValue; + } else if (isViewportChange(event) && isViewportChange(lastEvent)) { + // Merge viewport change events. + lastEvent.viewTop = event.viewTop; + lastEvent.viewLeft = event.viewLeft; + lastEvent.scale = event.scale; + lastEvent.oldScale = event.oldScale; + } else if (isClick(event) && isBubbleOpen(lastEvent)) { + // Drop click events caused by opening/closing bubbles. + } else { + mergedQueue.push(event); } } // Filter out any events that have become null due to merging. - queue = mergedQueue.filter(function (e) { - return !e.isNull(); - }); + queue = mergedQueue.filter((e) => !e.isNull()); if (!forward) { // Restore undo order. queue.reverse(); } - // Move mutation events to the top of the queue. - // Intentionally skip first event. - for (let i = 1, event; (event = queue[i]); i++) { - // AnyDuringMigration because: Property 'element' does not exist on type - // 'Abstract'. - if ( - event.type === EventType.BLOCK_CHANGE && - (event as AnyDuringMigration).element === 'mutation' - ) { - queue.unshift(queue.splice(i, 1)[0]); - } - } return queue; } @@ -420,6 +467,7 @@ export function disableOrphans(event: Abstract) { export const TEST_ONLY = { FIRE_QUEUE, + enqueueEvent, fireNow, fireInternal, setGroupInternal, diff --git a/tests/mocha/event_test.js b/tests/mocha/event_test.js index 75b52bede..545659f2d 100644 --- a/tests/mocha/event_test.js +++ b/tests/mocha/event_test.js @@ -42,6 +42,26 @@ suite('Events', function () { 'type': 'simple_test_block', 'message0': 'simple test block', }, + { + 'type': 'inputs_test_block', + 'message0': 'first %1 second %2', + 'args0': [ + { + 'type': 'input_statement', + 'name': 'STATEMENT1', + }, + { + 'type': 'input_statement', + 'name': 'STATEMENT2', + }, + ], + }, + { + 'type': 'statement_test_block', + 'message0': '', + 'previousStatement': null, + 'nextStatement': null, + }, ]); }); @@ -1102,6 +1122,165 @@ suite('Events', function () { }); }); + suite('enqueueEvent', function () { + const {FIRE_QUEUE, enqueueEvent} = eventUtils.TEST_ONLY; + + function newDisconnectEvent(parent, child, inputName, workspaceId) { + const event = new Blockly.Events.BlockMove(child); + event.workspaceId = workspaceId; + event.oldParentId = parent.id; + event.oldInputName = inputName; + event.oldCoordinate = undefined; + event.newParentId = undefined; + event.newInputName = undefined; + event.newCoordinate = new Blockly.utils.Coordinate(0, 0); + return event; + } + + function newConnectEvent(parent, child, inputName, workspaceId) { + const event = new Blockly.Events.BlockMove(child); + event.workspaceId = workspaceId; + event.oldParentId = undefined; + event.oldInputName = undefined; + event.oldCoordinate = new Blockly.utils.Coordinate(0, 0); + event.newParentId = parent.id; + event.newInputName = inputName; + event.newCoordinate = undefined; + return event; + } + + function newMutationEvent(block, workspaceId) { + const event = new Blockly.Events.BlockChange(block); + event.workspaceId = workspaceId; + event.element = 'mutation'; + return event; + } + + test('Events are enqueued', function () { + // Disable events during block creation to avoid firing BlockCreate + // events. + eventUtils.disable(); + const block = this.workspace.newBlock('simple_test_block', '1'); + eventUtils.enable(); + + try { + assert.equal(FIRE_QUEUE.length, 0); + const events = [ + new Blockly.Events.BlockCreate(block), + new Blockly.Events.BlockMove(block), + new Blockly.Events.Click(block), + ]; + events.map((e) => enqueueEvent(e)); + assert.equal(FIRE_QUEUE.length, events.length, 'FIRE_QUEUE.length'); + for (let i = 0; i < events.length; i++) { + assert.equal(FIRE_QUEUE[i], events[i], `FIRE_QUEUE[${i}]`); + } + } finally { + FIRE_QUEUE.length = 0; + } + }); + + test('BlockChange event reordered', function () { + eventUtils.disable(); + const parent = this.workspace.newBlock('inputs_test_block', 'parent'); + const child1 = this.workspace.newBlock('statement_test_block', 'child1'); + const child2 = this.workspace.newBlock('statement_test_block', 'child2'); + eventUtils.enable(); + + try { + assert.equal(FIRE_QUEUE.length, 0); + const events = [ + newDisconnectEvent(parent, child1, 'STATEMENT1'), + newDisconnectEvent(parent, child2, 'STATEMENT2'), + newConnectEvent(parent, child1, 'STATEMENT1'), + newConnectEvent(parent, child2, 'STATEMENT2'), + newMutationEvent(parent), + ]; + events.map((e) => enqueueEvent(e)); + assert.equal(FIRE_QUEUE.length, events.length, 'FIRE_QUEUE.length'); + assert.equal(FIRE_QUEUE[0], events[0], 'FIRE_QUEUE[0]'); + assert.equal(FIRE_QUEUE[1], events[1], 'FIRE_QUEUE[1]'); + assert.equal(FIRE_QUEUE[2], events[4], 'FIRE_QUEUE[2]'); + assert.equal(FIRE_QUEUE[3], events[2], 'FIRE_QUEUE[3]'); + assert.equal(FIRE_QUEUE[4], events[3], 'FIRE_QUEUE[4]'); + } finally { + FIRE_QUEUE.length = 0; + } + }); + + test('BlockChange event for other workspace not reordered', function () { + eventUtils.disable(); + const parent = this.workspace.newBlock('inputs_test_block', 'parent'); + const child = this.workspace.newBlock('statement_test_block', 'child'); + eventUtils.enable(); + + try { + assert.equal(FIRE_QUEUE.length, 0); + const events = [ + newDisconnectEvent(parent, child, 'STATEMENT1', 'ws1'), + newConnectEvent(parent, child, 'STATEMENT1', 'ws1'), + newMutationEvent(parent, 'ws2'), + ]; + events.map((e) => enqueueEvent(e)); + assert.equal(FIRE_QUEUE.length, events.length, 'FIRE_QUEUE.length'); + for (let i = 0; i < events.length; i++) { + assert.equal(FIRE_QUEUE[i], events[i], `FIRE_QUEUE[${i}]`); + } + } finally { + FIRE_QUEUE.length = 0; + } + }); + + test('BlockChange event for other group not reordered', function () { + eventUtils.disable(); + const parent = this.workspace.newBlock('inputs_test_block', 'parent'); + const child = this.workspace.newBlock('statement_test_block', 'child'); + eventUtils.enable(); + + try { + assert.equal(FIRE_QUEUE.length, 0); + const events = []; + eventUtils.setGroup('group1'); + events.push(newDisconnectEvent(parent, child, 'STATEMENT1')); + events.push(newConnectEvent(parent, child, 'STATEMENT1')); + eventUtils.setGroup('group2'); + events.push(newMutationEvent(parent, 'ws2')); + events.map((e) => enqueueEvent(e)); + assert.equal(FIRE_QUEUE.length, events.length, 'FIRE_QUEUE.length'); + for (let i = 0; i < events.length; i++) { + assert.equal(FIRE_QUEUE[i], events[i], `FIRE_QUEUE[${i}]`); + } + } finally { + FIRE_QUEUE.length = 0; + eventUtils.setGroup(false); + } + }); + + test('BlockChange event for other parent not reordered', function () { + eventUtils.disable(); + const parent1 = this.workspace.newBlock('inputs_test_block', 'parent1'); + const parent2 = this.workspace.newBlock('inputs_test_block', 'parent2'); + const child = this.workspace.newBlock('statement_test_block', 'child'); + eventUtils.enable(); + + try { + assert.equal(FIRE_QUEUE.length, 0); + const events = [ + newDisconnectEvent(parent1, child, 'STATEMENT1', 'ws1'), + newConnectEvent(parent1, child, 'STATEMENT1', 'ws1'), + newMutationEvent(parent2, 'ws2'), + ]; + events.map((e) => enqueueEvent(e)); + assert.equal(FIRE_QUEUE.length, events.length, 'FIRE_QUEUE.length'); + for (let i = 0; i < events.length; i++) { + assert.equal(FIRE_QUEUE[i], events[i], `FIRE_QUEUE[${i}]`); + } + } finally { + FIRE_QUEUE.length = 0; + } + }); + }); + suite('Filters', function () { function addMoveEvent(events, block, newX, newY) { events.push(new Blockly.Events.BlockMove(block)); From 724828f68988d5fb2493bf3986e3ee26dab9db3d Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Fri, 30 Aug 2024 17:23:23 +0100 Subject: [PATCH 39/90] refactor: Use arrow functions when calling Array.prototype.filter (#8557) --- core/events/utils.ts | 9 ++------- core/utils/toolbox.ts | 6 +++--- core/workspace.ts | 10 ++-------- core/workspace_svg.ts | 4 +--- tests/mocha/event_test.js | 6 +++--- 5 files changed, 11 insertions(+), 24 deletions(-) diff --git a/core/events/utils.ts b/core/events/utils.ts index 7a2aca8ad..4753e7783 100644 --- a/core/events/utils.ts +++ b/core/events/utils.ts @@ -127,13 +127,8 @@ function fireNow() { const queue = filter(FIRE_QUEUE, true); FIRE_QUEUE.length = 0; for (const event of queue) { - if (!event.workspaceId) { - continue; - } - const eventWorkspace = common.getWorkspaceById(event.workspaceId); - if (eventWorkspace) { - eventWorkspace.fireChangeListener(event); - } + if (!event.workspaceId) continue; + common.getWorkspaceById(event.workspaceId)?.fireChangeListener(event); } } diff --git a/core/utils/toolbox.ts b/core/utils/toolbox.ts index fbf031ac6..296bb6dcc 100644 --- a/core/utils/toolbox.ts +++ b/core/utils/toolbox.ts @@ -285,9 +285,9 @@ function hasCategoriesInternal(toolboxJson: ToolboxInfo | null): boolean { return toolboxKind === CATEGORY_TOOLBOX_KIND; } - const categories = toolboxJson['contents'].filter(function (item) { - return item['kind'].toUpperCase() === 'CATEGORY'; - }); + const categories = toolboxJson['contents'].filter( + (item) => item['kind'].toUpperCase() === 'CATEGORY', + ); return !!categories.length; } diff --git a/core/workspace.ts b/core/workspace.ts index bc09d36fb..75bcd8147 100644 --- a/core/workspace.ts +++ b/core/workspace.ts @@ -255,9 +255,7 @@ export class Workspace implements IASTNodeLocation { blocks.sort(this.sortObjects_.bind(this)); } - return blocks.filter(function (block: Block) { - return !block.isInsertionMarker(); - }); + return blocks.filter((block) => !block.isInsertionMarker()); } /** @@ -341,11 +339,7 @@ export class Workspace implements IASTNodeLocation { // Insertion markers exist on the workspace for rendering reasons, but // aren't "real" blocks from a developer perspective. - const filtered = blocks.filter(function (block) { - return !block.isInsertionMarker(); - }); - - return filtered; + return blocks.filter((block) => !block.isInsertionMarker()); } /** Dispose of all blocks and comments in workspace. */ diff --git a/core/workspace_svg.ts b/core/workspace_svg.ts index a01bbe07e..a7d56d100 100644 --- a/core/workspace_svg.ts +++ b/core/workspace_svg.ts @@ -543,9 +543,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { // Update all blocks in workspace that have a style name. this.updateBlockStyles_( - this.getAllBlocks(false).filter(function (block) { - return !!block.getStyleName(); - }), + this.getAllBlocks(false).filter((block) => !!block.getStyleName()), ); // Update current toolbox selection. diff --git a/tests/mocha/event_test.js b/tests/mocha/event_test.js index 545659f2d..2669cc854 100644 --- a/tests/mocha/event_test.js +++ b/tests/mocha/event_test.js @@ -1745,9 +1745,9 @@ suite('Events', function () { // Fire all events this.clock.runAll(); - const disabledEvents = this.workspace.getUndoStack().filter(function (e) { - return e.element === 'disabled'; - }); + const disabledEvents = this.workspace + .getUndoStack() + .filter((e) => e.element === 'disabled'); assert.isEmpty( disabledEvents, 'Undo stack should not contain any disabled events', From 2409123d66728e143a0ea94bc3a264b253d6ca6d Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Tue, 3 Sep 2024 15:27:40 +0100 Subject: [PATCH 40/90] refactor: Omit unused exception arguments from catch blocks (#8559) Fixes #1770. --- appengine/blockly_compressed.js | 2 +- scripts/gulpfiles/build_tasks.js | 2 +- tests/compile/main.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/appengine/blockly_compressed.js b/appengine/blockly_compressed.js index dc118dfbe..837d6bb35 100644 --- a/appengine/blockly_compressed.js +++ b/appengine/blockly_compressed.js @@ -6,6 +6,6 @@ var msg = 'Compiled Blockly files should be loaded from https://unpkg.com/blockl console.log(msg); try { alert(msg); -} catch (_e) { +} catch { // Can't alert? Probably node.js. } diff --git a/scripts/gulpfiles/build_tasks.js b/scripts/gulpfiles/build_tasks.js index 27a02cf30..a00c1b17d 100644 --- a/scripts/gulpfiles/build_tasks.js +++ b/scripts/gulpfiles/build_tasks.js @@ -699,7 +699,7 @@ function buildAdvancedCompilationTest() { // a later browser-based test won't check it should the compile fail. try { fs.unlinkSync('./tests/compile/main_compressed.js'); - } catch (_e) { + } catch { // Probably it didn't exist. } diff --git a/tests/compile/main.js b/tests/compile/main.js index 9144c4d3b..bbca3909f 100644 --- a/tests/compile/main.js +++ b/tests/compile/main.js @@ -47,7 +47,7 @@ window['healthCheck'] = function() { const blockCount = getMainWorkspace().getFlyout().getWorkspace().getTopBlocks().length; return (blockCount > 5 && blockCount < 100); - } catch (_e) { + } catch { return false; } }; From 074a549f0941164cd9f015eb0b12c62d46cb3158 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Sep 2024 08:29:49 -0700 Subject: [PATCH 41/90] chore(deps): bump @blockly/dev-tools from 8.0.6 to 8.0.9 (#8562) Bumps [@blockly/dev-tools](https://github.com/google/blockly-samples/tree/HEAD/plugins/dev-tools) from 8.0.6 to 8.0.9. - [Release notes](https://github.com/google/blockly-samples/releases) - [Changelog](https://github.com/google/blockly-samples/blob/master/plugins/dev-tools/CHANGELOG.md) - [Commits](https://github.com/google/blockly-samples/commits/@blockly/dev-tools@8.0.9/plugins/dev-tools) --- updated-dependencies: - dependency-name: "@blockly/dev-tools" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7d4ed8abc..3ac210e43 100644 --- a/package-lock.json +++ b/package-lock.json @@ -81,9 +81,9 @@ } }, "node_modules/@blockly/block-test": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/@blockly/block-test/-/block-test-6.0.5.tgz", - "integrity": "sha512-k71CGCM6A7XZFyFQL/cnZkylhtfCgf3wTTG9Jymt7bkGZR6jVV1FSZYk0vaZ4tj+T2goqc8gb9VA1Jn8YWmoFA==", + "version": "6.0.8", + "resolved": "https://registry.npmjs.org/@blockly/block-test/-/block-test-6.0.8.tgz", + "integrity": "sha512-uJg7d79gqqZGuF8tWriT1SJHaELFWQgv4Hf8/j7EDn5qnCRkDtoDqDQrVWNsios3tJHXviFNL3aetWkbBNOrVA==", "dev": true, "engines": { "node": ">=8.17.0" @@ -93,16 +93,16 @@ } }, "node_modules/@blockly/dev-tools": { - "version": "8.0.6", - "resolved": "https://registry.npmjs.org/@blockly/dev-tools/-/dev-tools-8.0.6.tgz", - "integrity": "sha512-jC/XG7KKHqt1evxW/2/cnEgNEUsAzigsFjPNqwgCTyouJTORMxPDx/+CDIo3VPfRf2XFkEb/+KecjZz4SC+ToA==", + "version": "8.0.9", + "resolved": "https://registry.npmjs.org/@blockly/dev-tools/-/dev-tools-8.0.9.tgz", + "integrity": "sha512-ta8tzBOJRZdjKynDFTtzK8xWuEzsBlKIc84zX15OhBShUZqvrsS1abRNDcnVe8/ZH93K2yezCgVfAf3AcOFvbQ==", "dev": true, "dependencies": { - "@blockly/block-test": "^6.0.5", - "@blockly/theme-dark": "^7.0.4", - "@blockly/theme-deuteranopia": "^6.0.4", - "@blockly/theme-highcontrast": "^6.0.4", - "@blockly/theme-tritanopia": "^6.0.4", + "@blockly/block-test": "^6.0.8", + "@blockly/theme-dark": "^7.0.7", + "@blockly/theme-deuteranopia": "^6.0.7", + "@blockly/theme-highcontrast": "^6.0.7", + "@blockly/theme-tritanopia": "^6.0.7", "chai": "^4.2.0", "dat.gui": "^0.7.7", "lodash.assign": "^4.2.0", @@ -187,9 +187,9 @@ } }, "node_modules/@blockly/theme-dark": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/@blockly/theme-dark/-/theme-dark-7.0.4.tgz", - "integrity": "sha512-HJgP+3g5YYt8Zqe7DSstT0mM13BgsSKwuXNSD8iC7nNxldKu+uEWcoOdAIOy3oLifmnDJ6cYk924+KM6JLUnhQ==", + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/@blockly/theme-dark/-/theme-dark-7.0.7.tgz", + "integrity": "sha512-p6urK/fLyzLhrHcSo1DhEvRkasyJjBYDpBPgPipAqGNJRlLR1pbNoBRcrpv3RzTgKIKbA0TeawsWHrHOXG0S/w==", "dev": true, "engines": { "node": ">=8.17.0" @@ -199,9 +199,9 @@ } }, "node_modules/@blockly/theme-deuteranopia": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/@blockly/theme-deuteranopia/-/theme-deuteranopia-6.0.4.tgz", - "integrity": "sha512-8nQ6Q+eRpHOA5ZSUWShPavYBE/TDzKrSEW5F2flpYTM/Yepyv55d8hKm/0ZxxKPbYO7deqx2iwfriAVFHwpDOQ==", + "version": "6.0.7", + "resolved": "https://registry.npmjs.org/@blockly/theme-deuteranopia/-/theme-deuteranopia-6.0.7.tgz", + "integrity": "sha512-br1pto4qKhHQYYZZdzWz+gooBmH0MAIpnu038BIzEiRzpcXtKNvsPexwVLAqYII+w37rZTvE4vgl/9yjH/AzJA==", "dev": true, "engines": { "node": ">=8.17.0" @@ -211,9 +211,9 @@ } }, "node_modules/@blockly/theme-highcontrast": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/@blockly/theme-highcontrast/-/theme-highcontrast-6.0.4.tgz", - "integrity": "sha512-c9EBTQbOcBfOun8VRJsRNt8BvMI1Y6K2KZr6XIX4ur04O+XUMXixid8+4xceEajFSZd7IKB19CEwUkO3hjWXNQ==", + "version": "6.0.7", + "resolved": "https://registry.npmjs.org/@blockly/theme-highcontrast/-/theme-highcontrast-6.0.7.tgz", + "integrity": "sha512-zZry3A1UBbuDclo3+yhJ45te5dQypwMCbao4djR28PVQEousM1t6h7AiQHy8zCop+nxqVSTESsgjEt96OQTb/g==", "dev": true, "engines": { "node": ">=8.17.0" @@ -236,9 +236,9 @@ } }, "node_modules/@blockly/theme-tritanopia": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/@blockly/theme-tritanopia/-/theme-tritanopia-6.0.4.tgz", - "integrity": "sha512-7bHo8tZcjL3xP7FM23R7kxJSN2K8kwn5KA0jx2GQ5gMbd+woHRo0VBXV/HeH5d6ulFTPUNoCb9XjuTVLRiW6zQ==", + "version": "6.0.7", + "resolved": "https://registry.npmjs.org/@blockly/theme-tritanopia/-/theme-tritanopia-6.0.7.tgz", + "integrity": "sha512-AF0iyzFYxY41pOVvZiCy1kAa4LeIHL9007B2xfRbVN/bTEA4rnd4W2k3XaEGv9xO026iBfvfRL9DJ9xASF9LFw==", "dev": true, "engines": { "node": ">=8.17.0" From 4d0fd5db791a32e375d7774c9038578f5c1166bb Mon Sep 17 00:00:00 2001 From: Chang Min Bark <88669927+changminbark@users.noreply.github.com> Date: Tue, 3 Sep 2024 23:12:40 +0700 Subject: [PATCH 42/90] fix(comments): added workspace comments and comment drag strategy isDeadOrDying() checks (#8532) * fix: added id to rendered ws comments; made getCommentById public; added blocklyDraggable class to ws comments * fix: added workspace comments and comment drag strategy isDeadOrDying checks * chore: removed .idea files * chore: formatted with prettier --- core/comments/workspace_comment.ts | 6 +++++- core/dragging/comment_drag_strategy.ts | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/core/comments/workspace_comment.ts b/core/comments/workspace_comment.ts index bda77f28c..2d59c715e 100644 --- a/core/comments/workspace_comment.ts +++ b/core/comments/workspace_comment.ts @@ -184,7 +184,11 @@ export class WorkspaceComment { * workspace is read-only. */ isDeletable(): boolean { - return this.isOwnDeletable() && !this.workspace.options.readOnly; + return ( + this.isOwnDeletable() && + !this.isDeadOrDying() && + !this.workspace.options.readOnly + ); } /** diff --git a/core/dragging/comment_drag_strategy.ts b/core/dragging/comment_drag_strategy.ts index bc48c0e6c..dd8b10fc2 100644 --- a/core/dragging/comment_drag_strategy.ts +++ b/core/dragging/comment_drag_strategy.ts @@ -26,7 +26,11 @@ export class CommentDragStrategy implements IDragStrategy { } isMovable(): boolean { - return this.comment.isOwnMovable() && !this.workspace.options.readOnly; + return ( + this.comment.isOwnMovable() && + !this.comment.isDeadOrDying() && + !this.workspace.options.readOnly + ); } startDrag(): void { From 0c29d8809ac41922063dea465231bbf57f569e07 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Sep 2024 17:14:22 +0100 Subject: [PATCH 43/90] chore(deps): bump jsdom from 24.1.1 to 25.0.0 (#8553) Bumps [jsdom](https://github.com/jsdom/jsdom) from 24.1.1 to 25.0.0. - [Release notes](https://github.com/jsdom/jsdom/releases) - [Changelog](https://github.com/jsdom/jsdom/blob/main/Changelog.md) - [Commits](https://github.com/jsdom/jsdom/compare/24.1.1...25.0.0) --- updated-dependencies: - dependency-name: jsdom dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3ac210e43..389916b04 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "jsdom": "24.1.1" + "jsdom": "25.0.0" }, "devDependencies": { "@blockly/block-test": "^6.0.4", @@ -6123,9 +6123,9 @@ } }, "node_modules/jsdom": { - "version": "24.1.1", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-24.1.1.tgz", - "integrity": "sha512-5O1wWV99Jhq4DV7rCLIoZ/UIhyQeDR7wHVyZAHAshbrvZsLs+Xzz7gtwnlJTJDjleiTKh54F4dXrX70vJQTyJQ==", + "version": "25.0.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-25.0.0.tgz", + "integrity": "sha512-OhoFVT59T7aEq75TVw9xxEfkXgacpqAhQaYgP9y/fDqWQCMB/b1H66RfmPm/MaeaAIU9nDwMOVTlPN51+ao6CQ==", "dependencies": { "cssstyle": "^4.0.1", "data-urls": "^5.0.0", diff --git a/package.json b/package.json index fa7ab7163..84bf44b98 100644 --- a/package.json +++ b/package.json @@ -143,7 +143,7 @@ "yargs": "^17.2.1" }, "dependencies": { - "jsdom": "24.1.1" + "jsdom": "25.0.0" }, "engines": { "node": ">=18" From d10c56461b9b8b80d5ded134a532441ffabf096b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Sep 2024 17:16:55 +0100 Subject: [PATCH 44/90] chore(deps): bump webdriverio from 8.39.0 to 9.0.7 (#8561) Bumps [webdriverio](https://github.com/webdriverio/webdriverio/tree/HEAD/packages/webdriverio) from 8.39.0 to 9.0.7. - [Release notes](https://github.com/webdriverio/webdriverio/releases) - [Changelog](https://github.com/webdriverio/webdriverio/blob/main/CHANGELOG.md) - [Commits](https://github.com/webdriverio/webdriverio/commits/v9.0.7/packages/webdriverio) --- updated-dependencies: - dependency-name: webdriverio dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 1407 ++++++++++++++++++--------------------------- package.json | 2 +- 2 files changed, 563 insertions(+), 846 deletions(-) diff --git a/package-lock.json b/package-lock.json index 389916b04..4d8de7dba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -52,7 +52,7 @@ "readline-sync": "^1.4.10", "rimraf": "^5.0.0", "typescript": "^5.3.3", - "webdriverio": "^8.32.2", + "webdriverio": "^9.0.7", "yargs": "^17.2.1" }, "engines": { @@ -563,18 +563,6 @@ "node": ">=12" } }, - "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, "node_modules/@isaacs/cliui/node_modules/ansi-styles": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", @@ -951,9 +939,9 @@ } }, "node_modules/@promptbook/utils": { - "version": "0.58.0", - "resolved": "https://registry.npmjs.org/@promptbook/utils/-/utils-0.58.0.tgz", - "integrity": "sha512-TglWndmjikWN+OGg9eNOUaMTM7RHr8uFCtgxfWULT1BUjcohywdijf54vS1U4mZ1tBLdHD4/fIrIHtmHzPUIZQ==", + "version": "0.68.0", + "resolved": "https://registry.npmjs.org/@promptbook/utils/-/utils-0.68.0.tgz", + "integrity": "sha512-EaV8YtUrbFLAjwOx9JcJqnfSiF+dm4kLrB2umzVJn/yEFMIOoC0GTWz1mX328HSA5cBvqC7+SBeWubplL9THcg==", "dev": true, "funding": [ { @@ -966,68 +954,41 @@ } ], "dependencies": { - "spacetrim": "0.11.36" + "spacetrim": "0.11.39" } }, "node_modules/@puppeteer/browsers": { - "version": "1.4.6", - "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-1.4.6.tgz", - "integrity": "sha512-x4BEjr2SjOPowNeiguzjozQbsc6h437ovD/wu+JpaenxVLm3jkgzHY2xOslMTp50HoTvQreMjiexiGQw1sqZlQ==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.3.1.tgz", + "integrity": "sha512-uK7o3hHkK+naEobMSJ+2ySYyXtQkBxIH8Gn4MK9ciePjNV+Pf+PgY/W7iPzn2MTjl3stcYB5AlcTmPYw7AXDwA==", "dev": true, "dependencies": { - "debug": "4.3.4", - "extract-zip": "2.0.1", - "progress": "2.0.3", - "proxy-agent": "6.3.0", - "tar-fs": "3.0.4", - "unbzip2-stream": "1.4.3", - "yargs": "17.7.1" + "debug": "^4.3.6", + "extract-zip": "^2.0.1", + "progress": "^2.0.3", + "proxy-agent": "^6.4.0", + "semver": "^7.6.3", + "tar-fs": "^3.0.6", + "unbzip2-stream": "^1.4.3", + "yargs": "^17.7.2" }, "bin": { "browsers": "lib/cjs/main-cli.js" }, "engines": { - "node": ">=16.3.0" - }, - "peerDependencies": { - "typescript": ">= 4.7.4" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "node": ">=18" } }, - "node_modules/@puppeteer/browsers/node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "node_modules/@puppeteer/browsers/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" + "bin": { + "semver": "bin/semver.js" }, "engines": { - "node": ">=12" - } - }, - "node_modules/@puppeteer/browsers/node_modules/yargs": { - "version": "17.7.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.1.tgz", - "integrity": "sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw==", - "dev": true, - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" + "node": ">=10" } }, "node_modules/@rushstack/node-core-library": { @@ -1140,18 +1101,6 @@ "sprintf-js": "~1.0.2" } }, - "node_modules/@sindresorhus/is": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", - "integrity": "sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==", - "dev": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" - } - }, "node_modules/@sinonjs/commons": { "version": "1.8.3", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", @@ -1187,18 +1136,6 @@ "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", "dev": true }, - "node_modules/@szmarczak/http-timer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", - "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", - "dev": true, - "dependencies": { - "defer-to-connect": "^2.0.1" - }, - "engines": { - "node": ">=14.16" - } - }, "node_modules/@tootallnate/quickjs-emscripten": { "version": "0.23.0", "resolved": "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz", @@ -1248,12 +1185,6 @@ "integrity": "sha512-Q5Vn3yjTDyCMV50TB6VRIbQNxSE4OmZR86VSbGaNpfUolm0iePBB4KdEEHmxoY5sT2+2DIvXW0rvMDP2nHZ4Mg==", "dev": true }, - "node_modules/@types/http-cache-semantics": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", - "integrity": "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==", - "dev": true - }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", @@ -1261,9 +1192,18 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.3.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.0.tgz", - "integrity": "sha512-cumHmIAf6On83X7yP+LrsEyUOf/YlociZelmpRYaGFydoaPdxdt80MAbu6vWerQT2COCp2nPvHdsbD7tHn/YlQ==", + "version": "20.16.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.3.tgz", + "integrity": "sha512-/wdGiWRkMOm53gAsSyFMXFZHbVg7C6CbkrzHNpaHoYfsUWPg7m6ZRKtvQjgvQ9i8WT540a3ydRlRQbxjY30XxQ==", + "dev": true, + "dependencies": { + "undici-types": "~6.19.2" + } + }, + "node_modules/@types/sinonjs__fake-timers": { + "version": "8.1.5", + "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.5.tgz", + "integrity": "sha512-mQkU2jY8jJEF7YHjHvsQO8+3ughTL1mcnn96igfhONmR+fUPSKIkefQYpSe8bsly2Ep7oQbn/6VG5/9/0qcArQ==", "dev": true }, "node_modules/@types/vinyl": { @@ -1283,18 +1223,18 @@ "dev": true }, "node_modules/@types/ws": { - "version": "8.5.10", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.10.tgz", - "integrity": "sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==", + "version": "8.5.12", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.12.tgz", + "integrity": "sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ==", "dev": true, "dependencies": { "@types/node": "*" } }, "node_modules/@types/yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==", + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", + "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==", "dev": true, "optional": true, "dependencies": { @@ -1703,39 +1643,27 @@ "dev": true }, "node_modules/@wdio/config": { - "version": "8.39.0", - "resolved": "https://registry.npmjs.org/@wdio/config/-/config-8.39.0.tgz", - "integrity": "sha512-yNuGPMPibY91s936gnJCHWlStvIyDrwLwGfLC/NCdTin4F7HL4Gp5iJnHWkJFty1/DfFi8jjoIUBNLM8HEez+A==", + "version": "9.0.6", + "resolved": "https://registry.npmjs.org/@wdio/config/-/config-9.0.6.tgz", + "integrity": "sha512-WsACM5QjT3ZsoPVqHroYt8pOkZx4/6PTdNKm45VL8NHhQe5w9IFbl1fKxFHQ7ZkPI3F+EFvFvubO8puJ0OcSmQ==", "dev": true, "dependencies": { - "@wdio/logger": "8.38.0", - "@wdio/types": "8.39.0", - "@wdio/utils": "8.39.0", + "@wdio/logger": "9.0.4", + "@wdio/types": "9.0.4", + "@wdio/utils": "9.0.6", "decamelize": "^6.0.0", - "deepmerge-ts": "^5.0.0", + "deepmerge-ts": "^7.0.3", "glob": "^10.2.2", "import-meta-resolve": "^4.0.0" }, "engines": { - "node": "^16.13 || >=18" - } - }, - "node_modules/@wdio/config/node_modules/decamelize": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-6.0.0.tgz", - "integrity": "sha512-Fv96DCsdOgB6mdGl67MT5JaTNKRzrzill5OH5s8bjYJXVlcXyPYGyPsUkWyGV5p1TXI5esYIYMMeDJL0hEIwaA==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=18" } }, "node_modules/@wdio/logger": { - "version": "8.38.0", - "resolved": "https://registry.npmjs.org/@wdio/logger/-/logger-8.38.0.tgz", - "integrity": "sha512-kcHL86RmNbcQP+Gq/vQUGlArfU6IIcbbnNp32rRIraitomZow+iEoc519rdQmSVusDozMS5DZthkgDdxK+vz6Q==", + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/@wdio/logger/-/logger-9.0.4.tgz", + "integrity": "sha512-b6gcu0PTVb3fgK4kyAH/k5UUWN5FOUdAfhA4PAY/IZvxZTMFYMqnrZb0WRWWWqL6nu9pcrOVtCOdPBvj0cb+Nw==", "dev": true, "dependencies": { "chalk": "^5.1.2", @@ -1744,19 +1672,7 @@ "strip-ansi": "^7.1.0" }, "engines": { - "node": "^16.13 || >=18" - } - }, - "node_modules/@wdio/logger/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" + "node": ">=18" } }, "node_modules/@wdio/logger/node_modules/chalk": { @@ -1787,118 +1703,57 @@ } }, "node_modules/@wdio/protocols": { - "version": "8.38.0", - "resolved": "https://registry.npmjs.org/@wdio/protocols/-/protocols-8.38.0.tgz", - "integrity": "sha512-7BPi7aXwUtnXZPeWJRmnCNFjyDvGrXlBmN9D4Pi58nILkyjVRQKEY9/qv/pcdyB0cvmIvw++Kl/1Lg+RxG++UA==", + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/@wdio/protocols/-/protocols-9.0.4.tgz", + "integrity": "sha512-T9v8Jkp94NxLLil5J7uJ/+YHk5/7fhOggzGcN+LvuCHS6jbJFZ/11c4SUEuXw27Yqk01fFXPBbF6TwcTTOuW/Q==", "dev": true }, "node_modules/@wdio/repl": { - "version": "8.24.12", - "resolved": "https://registry.npmjs.org/@wdio/repl/-/repl-8.24.12.tgz", - "integrity": "sha512-321F3sWafnlw93uRTSjEBVuvWCxTkWNDs7ektQS15drrroL3TMeFOynu4rDrIz0jXD9Vas0HCD2Tq/P0uxFLdw==", + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/@wdio/repl/-/repl-9.0.4.tgz", + "integrity": "sha512-5Bc5ARjWA7t6MZNnVJ9WvO1iDsy6iOsrSDWiP7APWAdaF/SJCP3SFE2c+PdQJpJWhr2Kk0fRGuyDM+GdsmZhwg==", "dev": true, "dependencies": { "@types/node": "^20.1.0" }, "engines": { - "node": "^16.13 || >=18" + "node": ">=18" } }, "node_modules/@wdio/types": { - "version": "8.39.0", - "resolved": "https://registry.npmjs.org/@wdio/types/-/types-8.39.0.tgz", - "integrity": "sha512-86lcYROTapOJuFd9ouomFDfzDnv3Kn+jE0RmqfvN9frZAeLVJ5IKjX9M6HjplsyTZhjGO1uCaehmzx+HJus33Q==", + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/@wdio/types/-/types-9.0.4.tgz", + "integrity": "sha512-MN7O4Uk3zPWvkN8d6SNdIjd7qHUlTxS7j0QfRPu6TdlYbHu6BJJ8Rr84y7GcUzCnTAJ1nOIpvUyR8MY3hOaVKg==", "dev": true, "dependencies": { "@types/node": "^20.1.0" }, "engines": { - "node": "^16.13 || >=18" + "node": ">=18" } }, "node_modules/@wdio/utils": { - "version": "8.39.0", - "resolved": "https://registry.npmjs.org/@wdio/utils/-/utils-8.39.0.tgz", - "integrity": "sha512-jY+n6jlGeK+9Tx8T659PKLwMQTGpLW5H78CSEWgZLbjbVSr2LfGR8Lx0CRktNXxAtqEVZPj16Pi74OtAhvhE6Q==", + "version": "9.0.6", + "resolved": "https://registry.npmjs.org/@wdio/utils/-/utils-9.0.6.tgz", + "integrity": "sha512-cnPXeW/sfqyKFuRRmADRZDNvFwEBMr7j7wwWLO6q5opoW++dwOdJW4WV0wDZbPcXTtGFCSrGCDLLdGcTAWMb3A==", "dev": true, "dependencies": { - "@puppeteer/browsers": "^1.6.0", - "@wdio/logger": "8.38.0", - "@wdio/types": "8.39.0", + "@puppeteer/browsers": "^2.2.0", + "@wdio/logger": "9.0.4", + "@wdio/types": "9.0.4", "decamelize": "^6.0.0", - "deepmerge-ts": "^5.1.0", - "edgedriver": "^5.5.0", - "geckodriver": "^4.3.1", + "deepmerge-ts": "^7.0.3", + "edgedriver": "^5.6.1", + "geckodriver": "^4.3.3", "get-port": "^7.0.0", "import-meta-resolve": "^4.0.0", - "locate-app": "^2.1.0", - "safaridriver": "^0.1.0", + "locate-app": "^2.2.24", + "safaridriver": "^0.1.2", "split2": "^4.2.0", - "wait-port": "^1.0.4" + "wait-port": "^1.1.0" }, "engines": { - "node": "^16.13 || >=18" - } - }, - "node_modules/@wdio/utils/node_modules/@puppeteer/browsers": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-1.9.1.tgz", - "integrity": "sha512-PuvK6xZzGhKPvlx3fpfdM2kYY3P/hB1URtK8wA7XUJ6prn6pp22zvJHu48th0SGcHL9SutbPHrFuQgfXTFobWA==", - "dev": true, - "dependencies": { - "debug": "4.3.4", - "extract-zip": "2.0.1", - "progress": "2.0.3", - "proxy-agent": "6.3.1", - "tar-fs": "3.0.4", - "unbzip2-stream": "1.4.3", - "yargs": "17.7.2" - }, - "bin": { - "browsers": "lib/cjs/main-cli.js" - }, - "engines": { - "node": ">=16.3.0" - } - }, - "node_modules/@wdio/utils/node_modules/decamelize": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-6.0.0.tgz", - "integrity": "sha512-Fv96DCsdOgB6mdGl67MT5JaTNKRzrzill5OH5s8bjYJXVlcXyPYGyPsUkWyGV5p1TXI5esYIYMMeDJL0hEIwaA==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@wdio/utils/node_modules/lru-cache": { - "version": "7.18.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", - "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/@wdio/utils/node_modules/proxy-agent": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.3.1.tgz", - "integrity": "sha512-Rb5RVBy1iyqOtNl15Cw/llpeLH8bsb37gM1FUfKQ+Wck6xHlbAhWGUFiTRHtkjqGTA5pSHz6+0hrPW/oECihPQ==", - "dev": true, - "dependencies": { - "agent-base": "^7.0.2", - "debug": "^4.3.4", - "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.2", - "lru-cache": "^7.14.1", - "pac-proxy-agent": "^7.0.1", - "proxy-from-env": "^1.1.0", - "socks-proxy-agent": "^8.0.2" - }, - "engines": { - "node": ">= 14" + "node": ">=18" } }, "node_modules/@yarnpkg/lockfile": { @@ -1908,9 +1763,9 @@ "dev": true }, "node_modules/@zip.js/zip.js": { - "version": "2.7.45", - "resolved": "https://registry.npmjs.org/@zip.js/zip.js/-/zip.js-2.7.45.tgz", - "integrity": "sha512-Mm2EXF33DJQ/3GWWEWeP1UCqzpQ5+fiMvT3QWspsXY05DyqqxWu7a9awSzU4/spHMHVFrTjani1PR0vprgZpow==", + "version": "2.7.52", + "resolved": "https://registry.npmjs.org/@zip.js/zip.js/-/zip.js-2.7.52.tgz", + "integrity": "sha512-+5g7FQswvrCHwYKNMd/KFxZSObctLSsQOgqBSi0LzwHo3li9Eh1w5cF5ndjQw9Zbr3ajVnd2+XyiX85gAetx1Q==", "dev": true, "engines": { "bun": ">=0.7.0", @@ -1952,9 +1807,9 @@ } }, "node_modules/agent-base": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", - "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", "dependencies": { "debug": "^4.3.4" }, @@ -2052,6 +1907,18 @@ "node": ">=0.10.0" } }, + "node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, "node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -2294,12 +2161,12 @@ "dev": true }, "node_modules/aria-query": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.0.0.tgz", - "integrity": "sha512-V+SM7AbUwJ+EBnB8+DXs0hPZHO0W6pqBcc0dW90OwtVG02PswOu/teuARoLQjdDOH+t9pJgGnW5/Qmouf3gPJg==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", + "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", "dev": true, - "engines": { - "node": ">=6.0" + "dependencies": { + "dequal": "^2.0.3" } }, "node_modules/arr-diff": { @@ -2379,9 +2246,9 @@ } }, "node_modules/ast-types/node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", "dev": true }, "node_modules/async": { @@ -2476,9 +2343,9 @@ "optional": true }, "node_modules/bare-fs": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-2.3.1.tgz", - "integrity": "sha512-W/Hfxc/6VehXlsgFtbB5B4xFcsCl+pAh30cYhoFyXErf6oGrwjh8SwiPAdHgpmWonKuYpZgGywN0SXt7dgsADA==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-2.3.3.tgz", + "integrity": "sha512-7RYKL+vZVCyAsMLi5SPu7QGauGGT8avnP/HO571ndEuV4MYdGXvLhtW67FuLPeEI8EiIY7zbbRR9x7x7HU0kgw==", "dev": true, "optional": true, "dependencies": { @@ -2488,9 +2355,9 @@ } }, "node_modules/bare-os": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-2.4.0.tgz", - "integrity": "sha512-v8DTT08AS/G0F9xrhyLtepoo9EJBJ85FRSMbu1pQUlAf6A8T0tEEQGMVObWeqpjhSPXsE0VGlluFBJu2fdoTNg==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-2.4.2.tgz", + "integrity": "sha512-HZoJwzC+rZ9lqEemTMiO0luOePoGYNBgsLLgegKR/cljiJvcDNhDZQkzC+NC5Oh0aHbdBNSOHpghwMuB5tqhjg==", "dev": true, "optional": true }, @@ -2505,9 +2372,9 @@ } }, "node_modules/bare-stream": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.1.3.tgz", - "integrity": "sha512-tiDAH9H/kP+tvNO5sczyn9ZAA7utrSMobyDchsnyyXBuUe2FSQWbxhtuHB8jwpHYYevVo2UJpcmvvjrbHboUUQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.2.0.tgz", + "integrity": "sha512-+o9MG5bPRRBlkVSpfFlMag3n7wMaIZb4YZasU2+/96f+3HTQ4F9DKQeu3K/Sjz1W0umu6xvVq1ON0ipWdMlr3A==", "dev": true, "optional": true, "dependencies": { @@ -2547,9 +2414,9 @@ } }, "node_modules/basic-ftp": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.3.tgz", - "integrity": "sha512-QHX8HLlncOLpy54mh+k/sWIFd0ThmRqwe9ZjELybGZK+tZ8rUb9VO0saKJUROTbE+KhzDUT7xziGpGrW8Kmd+g==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.5.tgz", + "integrity": "sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg==", "dev": true, "engines": { "node": ">=10.0.0" @@ -2611,6 +2478,12 @@ "ieee754": "^1.2.1" } }, + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", + "dev": true + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -2666,7 +2539,7 @@ "node_modules/buffer-crc32": { "version": "0.2.13", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", + "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", "dev": true, "engines": { "node": "*" @@ -2687,45 +2560,6 @@ "node": ">= 0.8" } }, - "node_modules/cacheable-lookup": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", - "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", - "dev": true, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/cacheable-request": { - "version": "10.2.14", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.14.tgz", - "integrity": "sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==", - "dev": true, - "dependencies": { - "@types/http-cache-semantics": "^4.0.2", - "get-stream": "^6.0.1", - "http-cache-semantics": "^4.1.1", - "keyv": "^4.5.3", - "mimic-response": "^4.0.0", - "normalize-url": "^8.0.0", - "responselike": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/cacheable-request/node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -2776,6 +2610,48 @@ "node": ">= 16" } }, + "node_modules/cheerio": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0.tgz", + "integrity": "sha512-quS9HgjQpdaXOvsZz82Oz7uxtXiy6UIsIQcpBj7HRw2M63Skasm9qlDocAM7jNuaxdhpPU7c4kJN+gA5MCu4ww==", + "dev": true, + "dependencies": { + "cheerio-select": "^2.1.0", + "dom-serializer": "^2.0.0", + "domhandler": "^5.0.3", + "domutils": "^3.1.0", + "encoding-sniffer": "^0.2.0", + "htmlparser2": "^9.1.0", + "parse5": "^7.1.2", + "parse5-htmlparser2-tree-adapter": "^7.0.0", + "parse5-parser-stream": "^7.1.2", + "undici": "^6.19.5", + "whatwg-mimetype": "^4.0.0" + }, + "engines": { + "node": ">=18.17" + }, + "funding": { + "url": "https://github.com/cheeriojs/cheerio?sponsor=1" + } + }, + "node_modules/cheerio-select": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", + "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0", + "css-select": "^5.1.0", + "css-what": "^6.1.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, "node_modules/chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", @@ -2803,18 +2679,6 @@ "fsevents": "~2.3.2" } }, - "node_modules/chromium-bidi": { - "version": "0.4.16", - "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.4.16.tgz", - "integrity": "sha512-7ZbXdWERxRxSwo3txsBjjmc/NLxqb1Bk30mRb0BMS4YIaiV6zvKZqL/UAH+DdqcDYayDWk2n/y8klkBDODrPvA==", - "dev": true, - "dependencies": { - "mitt": "3.0.0" - }, - "peerDependencies": { - "devtools-protocol": "*" - } - }, "node_modules/ci-info": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", @@ -3268,15 +3132,6 @@ "safe-buffer": "~5.2.0" } }, - "node_modules/cross-fetch": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", - "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", - "dev": true, - "dependencies": { - "node-fetch": "^2.6.12" - } - }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -3302,6 +3157,22 @@ "source-map-resolve": "^0.6.0" } }, + "node_modules/css-select": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, "node_modules/css-shorthand-properties": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/css-shorthand-properties/-/css-shorthand-properties-1.1.1.tgz", @@ -3314,6 +3185,18 @@ "integrity": "sha1-Xv1sLupeof1rasV+wEJ7GEUkJOo=", "dev": true }, + "node_modules/css-what": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", + "dev": true, + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, "node_modules/css/node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -3340,12 +3223,12 @@ "dev": true }, "node_modules/data-uri-to-buffer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-5.0.1.tgz", - "integrity": "sha512-a9l6T1qqDogvvnw0nKlfZzqsyikEBZBClF39V3TFoKhDtGBqHu2HkuomJc02j5zft8zrUaXEuoicLeW54RkzPg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", "dev": true, "engines": { - "node": ">= 14" + "node": ">= 12" } }, "node_modules/data-urls": { @@ -3400,9 +3283,9 @@ } }, "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", "dependencies": { "ms": "2.1.2" }, @@ -3435,6 +3318,18 @@ "ms": "^2.1.1" } }, + "node_modules/decamelize": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-6.0.0.tgz", + "integrity": "sha512-Fv96DCsdOgB6mdGl67MT5JaTNKRzrzill5OH5s8bjYJXVlcXyPYGyPsUkWyGV5p1TXI5esYIYMMeDJL0hEIwaA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/decimal.js": { "version": "10.4.3", "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", @@ -3449,33 +3344,6 @@ "node": ">=0.10" } }, - "node_modules/decompress-response": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", - "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", - "dev": true, - "dependencies": { - "mimic-response": "^3.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/decompress-response/node_modules/mimic-response": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", - "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/deep-eql": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", @@ -3492,23 +3360,14 @@ "dev": true }, "node_modules/deepmerge-ts": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/deepmerge-ts/-/deepmerge-ts-5.1.0.tgz", - "integrity": "sha512-eS8dRJOckyo9maw9Tu5O5RUi/4inFLrnoLkBe3cPfDMx3WZioXtmOew4TXQaxq7Rhl4xjDtR7c6x8nNTxOvbFw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/deepmerge-ts/-/deepmerge-ts-7.1.0.tgz", + "integrity": "sha512-q6bNsfNBtgr8ZOQqmZbl94MmYWm+QcDNIkqCxVWiw1vKvf+y/N2dZQKdnDXn4c5Ygt/y63tDof6OCN+2YwWVEg==", "dev": true, "engines": { "node": ">=16.0.0" } }, - "node_modules/defer-to-connect": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", - "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/degenerator": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-5.0.1.tgz", @@ -3531,6 +3390,15 @@ "node": ">=0.4.0" } }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/detect-file": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", @@ -3549,12 +3417,6 @@ "node": ">=0.10.0" } }, - "node_modules/devtools-protocol": { - "version": "0.0.1302984", - "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1302984.tgz", - "integrity": "sha512-Rgh2Sk5fUSCtEx4QGH9iwTyECdFPySG2nlz5J8guGh2Wlha6uzSOCq/DCEC8faHlLaMPZJMuZ4ovgcX4LvOkKA==", - "dev": true - }, "node_modules/diff": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", @@ -3589,6 +3451,61 @@ "node": ">=6.0.0" } }, + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dev": true, + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dev": true, + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "dev": true, + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, "node_modules/each-props": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/each-props/-/each-props-3.0.0.tgz", @@ -3625,16 +3542,17 @@ } }, "node_modules/edgedriver": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/edgedriver/-/edgedriver-5.6.0.tgz", - "integrity": "sha512-IeJXEczG+DNYBIa9gFgVYTqrawlxmc9SUqUsWU2E98jOsO/amA7wzabKOS8Bwgr/3xWoyXCJ6yGFrbFKrilyyQ==", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/edgedriver/-/edgedriver-5.6.1.tgz", + "integrity": "sha512-3Ve9cd5ziLByUdigw6zovVeWJjVs8QHVmqOB0sJ0WNeVPcwf4p18GnxMmVvlFmYRloUwf5suNuorea4QzwBIOA==", "dev": true, "hasInstallScript": true, "dependencies": { - "@wdio/logger": "^8.28.0", - "@zip.js/zip.js": "^2.7.44", + "@wdio/logger": "^8.38.0", + "@zip.js/zip.js": "^2.7.48", "decamelize": "^6.0.0", "edge-paths": "^3.0.5", + "fast-xml-parser": "^4.4.1", "node-fetch": "^3.3.2", "which": "^4.0.0" }, @@ -3642,25 +3560,31 @@ "edgedriver": "bin/edgedriver.js" } }, - "node_modules/edgedriver/node_modules/data-uri-to-buffer": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", - "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", + "node_modules/edgedriver/node_modules/@wdio/logger": { + "version": "8.38.0", + "resolved": "https://registry.npmjs.org/@wdio/logger/-/logger-8.38.0.tgz", + "integrity": "sha512-kcHL86RmNbcQP+Gq/vQUGlArfU6IIcbbnNp32rRIraitomZow+iEoc519rdQmSVusDozMS5DZthkgDdxK+vz6Q==", "dev": true, + "dependencies": { + "chalk": "^5.1.2", + "loglevel": "^1.6.0", + "loglevel-plugin-prefix": "^0.8.4", + "strip-ansi": "^7.1.0" + }, "engines": { - "node": ">= 12" + "node": "^16.13 || >=18" } }, - "node_modules/edgedriver/node_modules/decamelize": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-6.0.0.tgz", - "integrity": "sha512-Fv96DCsdOgB6mdGl67MT5JaTNKRzrzill5OH5s8bjYJXVlcXyPYGyPsUkWyGV5p1TXI5esYIYMMeDJL0hEIwaA==", + "node_modules/edgedriver/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", "dev": true, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": "^12.17.0 || ^14.13 || >=16.0.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/edgedriver/node_modules/isexe": { @@ -3672,22 +3596,19 @@ "node": ">=16" } }, - "node_modules/edgedriver/node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "node_modules/edgedriver/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" + "ansi-regex": "^6.0.1" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=12" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, "node_modules/edgedriver/node_modules/which": { @@ -3711,6 +3632,31 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, + "node_modules/encoding-sniffer": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/encoding-sniffer/-/encoding-sniffer-0.2.0.tgz", + "integrity": "sha512-ju7Wq1kg04I3HtiYIOrUrdfdDvkyO9s5XM8QAj/bN61Yo/Vb4vgJxy5vi4Yxk01gWHbrofpPtpxM8bKger9jhg==", + "dev": true, + "dependencies": { + "iconv-lite": "^0.6.3", + "whatwg-encoding": "^3.1.1" + }, + "funding": { + "url": "https://github.com/fb55/encoding-sniffer?sponsor=1" + } + }, + "node_modules/encoding-sniffer/node_modules/whatwg-encoding": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", + "dev": true, + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", @@ -3721,9 +3667,9 @@ } }, "node_modules/entities": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.4.0.tgz", - "integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", "engines": { "node": ">=0.12" }, @@ -4226,6 +4172,28 @@ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, + "node_modules/fast-xml-parser": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz", + "integrity": "sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + }, + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + } + ], + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, "node_modules/fastest-levenshtein": { "version": "1.0.16", "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", @@ -4247,7 +4215,7 @@ "node_modules/fd-slicer": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", + "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", "dev": true, "dependencies": { "pend": "~1.2.0" @@ -4498,15 +4466,6 @@ "node": ">= 6" } }, - "node_modules/form-data-encoder": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-2.1.4.tgz", - "integrity": "sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw==", - "dev": true, - "engines": { - "node": ">= 14.17" - } - }, "node_modules/formdata-polyfill": { "version": "4.0.10", "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", @@ -4580,17 +4539,17 @@ } }, "node_modules/geckodriver": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/geckodriver/-/geckodriver-4.4.1.tgz", - "integrity": "sha512-nnAdIrwLkMcDu4BitWXF23pEMeZZ0Cj7HaWWFdSpeedBP9z6ft150JYiGO2mwzw6UiR823Znk1JeIf07RyzloA==", + "version": "4.4.4", + "resolved": "https://registry.npmjs.org/geckodriver/-/geckodriver-4.4.4.tgz", + "integrity": "sha512-0zaw19tcmWeluqx7+Y559JGBtidu1D0Lb8ElYKiNEQu8r3sCfrLUf5V10xypl8u29ZLbgRV7WflxCJVTCkCMFA==", "dev": true, "hasInstallScript": true, "dependencies": { - "@wdio/logger": "^8.28.0", - "@zip.js/zip.js": "^2.7.44", + "@wdio/logger": "^9.0.0", + "@zip.js/zip.js": "^2.7.48", "decamelize": "^6.0.0", "http-proxy-agent": "^7.0.2", - "https-proxy-agent": "^7.0.4", + "https-proxy-agent": "^7.0.5", "node-fetch": "^3.3.2", "tar-fs": "^3.0.6", "which": "^4.0.0" @@ -4602,27 +4561,6 @@ "node": "^16.13 || >=18 || >=20" } }, - "node_modules/geckodriver/node_modules/data-uri-to-buffer": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", - "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", - "dev": true, - "engines": { - "node": ">= 12" - } - }, - "node_modules/geckodriver/node_modules/decamelize": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-6.0.0.tgz", - "integrity": "sha512-Fv96DCsdOgB6mdGl67MT5JaTNKRzrzill5OH5s8bjYJXVlcXyPYGyPsUkWyGV5p1TXI5esYIYMMeDJL0hEIwaA==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/geckodriver/node_modules/isexe": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", @@ -4632,38 +4570,6 @@ "node": ">=16" } }, - "node_modules/geckodriver/node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", - "dev": true, - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" - } - }, - "node_modules/geckodriver/node_modules/tar-fs": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.6.tgz", - "integrity": "sha512-iokBDQQkUyeXhgPYaZxmczGPhnhXZ0CmrqI+MOb/WFGS9DW5wnfrLgtjUJBvz50vQ3qfRwJ62QVoCFu8mPVu5w==", - "dev": true, - "dependencies": { - "pump": "^3.0.0", - "tar-stream": "^3.1.5" - }, - "optionalDependencies": { - "bare-fs": "^2.1.1", - "bare-path": "^2.1.0" - } - }, "node_modules/geckodriver/node_modules/which": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz", @@ -4725,50 +4631,41 @@ } }, "node_modules/get-uri": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.1.tgz", - "integrity": "sha512-7ZqONUVqaabogsYNWlYj0t3YZaL6dhuEueZXGF+/YVmf6dHmaFg8/6psJKqhx9QykIDKzpGcy2cn4oV4YC7V/Q==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.3.tgz", + "integrity": "sha512-BzUrJBS9EcUb4cFol8r4W3v1cPsSyajLSthNkz5BxbpDcHN5tIrM10E2eNvfnvBn3DaT3DUgx0OpsBKkaOpanw==", "dev": true, "dependencies": { "basic-ftp": "^5.0.2", - "data-uri-to-buffer": "^5.0.1", + "data-uri-to-buffer": "^6.0.2", "debug": "^4.3.4", - "fs-extra": "^8.1.0" + "fs-extra": "^11.2.0" }, "engines": { "node": ">= 14" } }, + "node_modules/get-uri/node_modules/data-uri-to-buffer": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz", + "integrity": "sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==", + "dev": true, + "engines": { + "node": ">= 14" + } + }, "node_modules/get-uri/node_modules/fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", "dev": true, "dependencies": { "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" }, "engines": { - "node": ">=6 <7 || >=8" - } - }, - "node_modules/get-uri/node_modules/jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "dev": true, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/get-uri/node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true, - "engines": { - "node": ">= 4.0.0" + "node": ">=14.14" } }, "node_modules/glob": { @@ -5048,43 +4945,6 @@ "win32" ] }, - "node_modules/got": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", - "integrity": "sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==", - "dev": true, - "dependencies": { - "@sindresorhus/is": "^5.2.0", - "@szmarczak/http-timer": "^5.0.1", - "cacheable-lookup": "^7.0.0", - "cacheable-request": "^10.2.8", - "decompress-response": "^6.0.0", - "form-data-encoder": "^2.1.2", - "get-stream": "^6.0.1", - "http2-wrapper": "^2.1.10", - "lowercase-keys": "^3.0.0", - "p-cancelable": "^3.0.0", - "responselike": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sindresorhus/got?sponsor=1" - } - }, - "node_modules/got/node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -5579,12 +5439,31 @@ "node": ">=12" } }, - "node_modules/http-cache-semantics": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", - "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", + "node_modules/htmlfy": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/htmlfy/-/htmlfy-0.2.1.tgz", + "integrity": "sha512-HoomFHQ3av1uhq+7FxJTq4Ns0clAD+tGbQNrSd0WFY3UAjjUk6G3LaWEqdgmIXYkY4pexZiyZ3ykZJhQlM0J5A==", "dev": true }, + "node_modules/htmlparser2": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-9.1.0.tgz", + "integrity": "sha512-5zfg6mHUoaer/97TxnGpxmbR7zJtPwIYFMZ/H5ucTlPZhKvtum05yiPK3Mgai3a0DyVxv7qYqoweaEd2nrYQzQ==", + "dev": true, + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.1.0", + "entities": "^4.5.0" + } + }, "node_modules/http-proxy": { "version": "1.18.1", "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", @@ -5638,19 +5517,6 @@ "node": ">=12" } }, - "node_modules/http2-wrapper": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.1.tgz", - "integrity": "sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==", - "dev": true, - "dependencies": { - "quick-lru": "^5.1.1", - "resolve-alpn": "^1.2.0" - }, - "engines": { - "node": ">=10.19.0" - } - }, "node_modules/https-proxy-agent": { "version": "7.0.5", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", @@ -6227,32 +6093,6 @@ "node": ">=18" } }, - "node_modules/jsdom/node_modules/ws": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", - "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/json-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true - }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -6358,15 +6198,6 @@ "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", "dev": true }, - "node_modules/keyv": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", - "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", - "dev": true, - "dependencies": { - "json-buffer": "3.0.1" - } - }, "node_modules/klaw-sync": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", @@ -6376,18 +6207,6 @@ "graceful-fs": "^4.1.11" } }, - "node_modules/ky": { - "version": "0.33.3", - "resolved": "https://registry.npmjs.org/ky/-/ky-0.33.3.tgz", - "integrity": "sha512-CasD9OCEQSFIam2U8efFK81Yeg8vNMTBUqtMOHlrcWQHqUX3HeCl9Dr31u4toV7emlH8Mymk5+9p0lL6mKb/Xw==", - "dev": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sindresorhus/ky?sponsor=1" - } - }, "node_modules/last-run": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/last-run/-/last-run-2.0.0.tgz", @@ -6474,9 +6293,9 @@ } }, "node_modules/locate-app": { - "version": "2.4.21", - "resolved": "https://registry.npmjs.org/locate-app/-/locate-app-2.4.21.tgz", - "integrity": "sha512-ySSBwlUnVKoLgw39q8YaNtvklhaTMoVqBf2+CuY3hkOFuWubHAJ6NJuTjv+jfTV1FuOgKsigRdsYUIeVgKHvNA==", + "version": "2.4.35", + "resolved": "https://registry.npmjs.org/locate-app/-/locate-app-2.4.35.tgz", + "integrity": "sha512-LmAKEZ5UR4yja7YTYyapV1eNG3Yc/W9N28xTX5tzOJ68NyWs4Laf6wmH3l8wST7T4kaaYaDqdW1UQ+5nOFVBpw==", "dev": true, "funding": [ { @@ -6489,7 +6308,7 @@ } ], "dependencies": { - "@promptbook/utils": "0.58.0", + "@promptbook/utils": "0.68.0", "type-fest": "2.13.0", "userhome": "1.0.0" } @@ -6614,18 +6433,6 @@ "get-func-name": "^2.0.1" } }, - "node_modules/lowercase-keys": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", - "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -6747,18 +6554,6 @@ "node": ">= 0.6" } }, - "node_modules/mimic-response": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", - "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -6786,12 +6581,6 @@ "node": ">=16 || 14 >=14.17" } }, - "node_modules/mitt": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.0.tgz", - "integrity": "sha512-7dX2/10ITVyqh4aOSVI9gdape+t9l2/8QxHrFmUXu4EEUpdlxl6RudZUPZoc+zuY2hk1j7XxVroIVIan/pD/SQ==", - "dev": true - }, "node_modules/mkdirp": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", @@ -6804,12 +6593,6 @@ "mkdirp": "bin/cmd.js" } }, - "node_modules/mkdirp-classic": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", - "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", - "dev": true - }, "node_modules/mocha": { "version": "10.7.3", "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.7.3.tgz", @@ -6854,29 +6637,6 @@ "balanced-match": "^1.0.0" } }, - "node_modules/mocha/node_modules/debug": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", - "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/mocha/node_modules/debug/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/mocha/node_modules/glob": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", @@ -7031,23 +6791,21 @@ } }, "node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", "dev": true, "dependencies": { - "whatwg-url": "^5.0.0" + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" }, "engines": { - "node": "4.x || >=6.0.0" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" } }, "node_modules/normalize-path": { @@ -7059,18 +6817,6 @@ "node": ">=0.10.0" } }, - "node_modules/normalize-url": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.1.tgz", - "integrity": "sha512-IO9QvjUMWxPQQhs60oOu10CRkWCiZzSUkzbXGGV9pviYl1fXYcvkzQ5jV9z8Y6un8ARoVRl4EtC6v6jNqbaJ/w==", - "dev": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/now-and-later": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/now-and-later/-/now-and-later-3.0.0.tgz", @@ -7083,6 +6829,18 @@ "node": ">= 10.13.0" } }, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, "node_modules/nwsapi": { "version": "2.2.12", "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.12.tgz", @@ -7184,15 +6942,6 @@ "node": ">=0.10.0" } }, - "node_modules/p-cancelable": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", - "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", - "dev": true, - "engines": { - "node": ">=12.20" - } - }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -7224,9 +6973,9 @@ } }, "node_modules/pac-proxy-agent": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.0.1.tgz", - "integrity": "sha512-ASV8yU4LLKBAjqIPMbrgtaKIvxQri/yh2OpI+S6hVa9JRkUI3Y3NPFbfngDtY7oFtSMD3w31Xns89mDa3Feo5A==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.0.2.tgz", + "integrity": "sha512-BFi3vZnO9X5Qt6NRz7ZOaPja3ic0PhlsmCRYLOpN11+mWBCR6XJDqW5RF3j8jm4WGGQZtBA+bTfxYzeKW73eHg==", "dev": true, "dependencies": { "@tootallnate/quickjs-emscripten": "^0.23.0", @@ -7234,9 +6983,9 @@ "debug": "^4.3.4", "get-uri": "^6.0.1", "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.2", - "pac-resolver": "^7.0.0", - "socks-proxy-agent": "^8.0.2" + "https-proxy-agent": "^7.0.5", + "pac-resolver": "^7.0.1", + "socks-proxy-agent": "^8.0.4" }, "engines": { "node": ">= 14" @@ -7329,6 +7078,31 @@ "url": "https://github.com/inikulin/parse5?sponsor=1" } }, + "node_modules/parse5-htmlparser2-tree-adapter": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz", + "integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==", + "dev": true, + "dependencies": { + "domhandler": "^5.0.2", + "parse5": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5-parser-stream": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5-parser-stream/-/parse5-parser-stream-7.1.2.tgz", + "integrity": "sha512-JyeQc9iwFLn5TbvvqACIF/VXG6abODeB3Fwmv/TGdLk2LfbWkaySGY72at4+Ty7EkPZj854u4CrICqNk2qIbow==", + "dev": true, + "dependencies": { + "parse5": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, "node_modules/patch-package": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-8.0.0.tgz", @@ -7531,7 +7305,7 @@ "node_modules/pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", + "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", "dev": true }, "node_modules/picocolors": { @@ -7708,19 +7482,19 @@ } }, "node_modules/proxy-agent": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.3.0.tgz", - "integrity": "sha512-0LdR757eTj/JfuU7TL2YCuAZnxWXu3tkJbg4Oq3geW/qFNT/32T0sp2HnZ9O0lMR4q3vwAt0+xCA8SR0WAD0og==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.4.0.tgz", + "integrity": "sha512-u0piLU+nCOHMgGjRbimiXmA9kM/L9EHh3zL81xCdp7m+Y2pHIsnmbdDoEDoAz5geaonNR6q6+yOPQs6n4T6sBQ==", "dev": true, "dependencies": { "agent-base": "^7.0.2", "debug": "^4.3.4", - "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.0", + "http-proxy-agent": "^7.0.1", + "https-proxy-agent": "^7.0.3", "lru-cache": "^7.14.1", - "pac-proxy-agent": "^7.0.0", + "pac-proxy-agent": "^7.0.1", "proxy-from-env": "^1.1.0", - "socks-proxy-agent": "^8.0.1" + "socks-proxy-agent": "^8.0.2" }, "engines": { "node": ">= 14" @@ -7764,37 +7538,6 @@ "node": ">=6" } }, - "node_modules/puppeteer-core": { - "version": "20.9.0", - "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-20.9.0.tgz", - "integrity": "sha512-H9fYZQzMTRrkboEfPmf7m3CLDN6JvbxXA3qTtS+dFt27tR+CsFHzPsT6pzp6lYL6bJbAPaR0HaPO6uSi+F94Pg==", - "dev": true, - "dependencies": { - "@puppeteer/browsers": "1.4.6", - "chromium-bidi": "0.4.16", - "cross-fetch": "4.0.0", - "debug": "4.3.4", - "devtools-protocol": "0.0.1147663", - "ws": "8.13.0" - }, - "engines": { - "node": ">=16.3.0" - }, - "peerDependencies": { - "typescript": ">= 4.7.4" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/puppeteer-core/node_modules/devtools-protocol": { - "version": "0.0.1147663", - "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1147663.tgz", - "integrity": "sha512-hyWmRrexdhbZ1tcJUGpO95ivbRhWXz++F4Ko+n21AY5PNln2ovoJw+8ZMNDTtip+CNFQfrtLVh/w4009dXO/eQ==", - "dev": true - }, "node_modules/qs": { "version": "6.5.3", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", @@ -7841,18 +7584,6 @@ "integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==", "dev": true }, - "node_modules/quick-lru": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", - "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -8044,12 +7775,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/resolve-alpn": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", - "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", - "dev": true - }, "node_modules/resolve-dir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", @@ -8084,25 +7809,10 @@ "node": ">= 10.13.0" } }, - "node_modules/responselike": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", - "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", - "dev": true, - "dependencies": { - "lowercase-keys": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/resq": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/resq/-/resq-1.10.1.tgz", - "integrity": "sha512-zhp1iyUH02MLciv3bIM2bNtTFx/fqRsK4Jk73jcPqp00d/sMTTjOtjdTMAcgjrQKGx5DvQ/HSpeqaMW0atGRJA==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/resq/-/resq-1.11.0.tgz", + "integrity": "sha512-G10EBz+zAAy3zUd/CDoBbXRL6ia9kOo3xRHrMDsHljI0GDkhYlyjwoCx5+3eCC4swi1uCoZQhskuJkj7Gp57Bw==", "dev": true, "dependencies": { "fast-deep-equal": "^2.0.1" @@ -8111,7 +7821,7 @@ "node_modules/resq/node_modules/fast-deep-equal": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "integrity": "sha512-bCK/2Z4zLidyB4ReuIsvALH6w31YfAQDmXMqMx6FyfHqvBxtjC0eRumeSu4Bs3XtXwpyIywtSTrVT99BxY1f9w==", "dev": true }, "node_modules/reusify": { @@ -8245,9 +7955,9 @@ } }, "node_modules/serialize-error": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-11.0.2.tgz", - "integrity": "sha512-o43i0jLcA0LXA5Uu+gI1Vj+lF66KR9IAcy0ThbGq1bAMPN+k5IgSHsulfnqf/ddKAz6dWf+k8PD5hAr9oCSHEQ==", + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-11.0.3.tgz", + "integrity": "sha512-2G2y++21dhj2R7iHAdd0FIzjGwuKZld+7Pl/bTU6YIkrC2ZMbVUjm+luj6A6V34Rv9XfKJDKpTWu9W4Gse1D9g==", "dev": true, "dependencies": { "type-fest": "^2.12.2" @@ -8384,14 +8094,14 @@ } }, "node_modules/socks-proxy-agent": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.2.tgz", - "integrity": "sha512-8zuqoLv1aP/66PHF5TqwJ7Czm3Yv32urJQHrVyhD7mmA6d61Zv8cIXQYPTWwmg6qlupnPvs/QKDmfa4P/qct2g==", + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.4.tgz", + "integrity": "sha512-GNAq/eg8Udq2x0eNiFkr9gRg5bA7PXEWagQdeRX4cPSG+X/8V38v637gim9bjFptMk1QWsCTr0ttrJEiXbNnRw==", "dev": true, "dependencies": { - "agent-base": "^7.0.2", + "agent-base": "^7.1.1", "debug": "^4.3.4", - "socks": "^2.7.1" + "socks": "^2.8.3" }, "engines": { "node": ">= 14" @@ -8417,9 +8127,9 @@ } }, "node_modules/spacetrim": { - "version": "0.11.36", - "resolved": "https://registry.npmjs.org/spacetrim/-/spacetrim-0.11.36.tgz", - "integrity": "sha512-jqv5aAfMLkBnFK+38QUtEGgU7x1KrfpDnCdjX4+W1IEVgA8Kf3tk8K9je8j2nkCSXdIngjda53fuXERr4/61kw==", + "version": "0.11.39", + "resolved": "https://registry.npmjs.org/spacetrim/-/spacetrim-0.11.39.tgz", + "integrity": "sha512-S/baW29azJ7py5ausQRE2S6uEDQnlxgMHOEEq4V770ooBDD1/9kZnxRcco/tjZYuDuqYXblCk/r3N13ZmvHZ2g==", "dev": true, "funding": [ { @@ -8659,6 +8369,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/strnum": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz", + "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==", + "dev": true + }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -8730,14 +8446,17 @@ "dev": true }, "node_modules/tar-fs": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.4.tgz", - "integrity": "sha512-5AFQU8b9qLfZCX9zp2duONhPmZv0hGYiBPJsyUdqMjzq/mqVpy/rEUSeHk1+YitmxugaptgBh5oDGU3VsAJq4w==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.6.tgz", + "integrity": "sha512-iokBDQQkUyeXhgPYaZxmczGPhnhXZ0CmrqI+MOb/WFGS9DW5wnfrLgtjUJBvz50vQ3qfRwJ62QVoCFu8mPVu5w==", "dev": true, "dependencies": { - "mkdirp-classic": "^0.5.2", "pump": "^3.0.0", "tar-stream": "^3.1.5" + }, + "optionalDependencies": { + "bare-fs": "^2.1.1", + "bare-path": "^2.1.0" } }, "node_modules/tar-stream": { @@ -8870,12 +8589,6 @@ "node": ">= 4.0.0" } }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "dev": true - }, "node_modules/tree-kill": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", @@ -9013,6 +8726,21 @@ "fastest-levenshtein": "^1.0.7" } }, + "node_modules/undici": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.19.8.tgz", + "integrity": "sha512-U8uCCl2x9TK3WANvmBavymRzxbfFYG+tAu+fgx3zxQy3qdagQqBLwJVrdyO1TBfUXvfKveMKJZhpvUYoOjM+4g==", + "dev": true, + "engines": { + "node": ">=18.17" + } + }, + "node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true + }, "node_modules/union": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz", @@ -9058,6 +8786,12 @@ "requires-port": "^1.0.0" } }, + "node_modules/urlpattern-polyfill": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-10.0.0.tgz", + "integrity": "sha512-H/A06tKD7sS1O1X2SshBVeA5FLycRpjqiBeqGKmBwBDBy28EnRjORxTNe269KSSr5un5qyWi1iL61wLxpd+ZOg==", + "dev": true + }, "node_modules/userhome": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/userhome/-/userhome-1.0.0.tgz", @@ -9282,67 +9016,67 @@ } }, "node_modules/webdriver": { - "version": "8.39.0", - "resolved": "https://registry.npmjs.org/webdriver/-/webdriver-8.39.0.tgz", - "integrity": "sha512-Kc3+SfiH4ufyrIht683VT2vnJocx0pfH8rYdyPvEh1b2OYewtFTHK36k9rBDHZiBmk6jcSXs4M2xeFgOuon9Lg==", + "version": "9.0.7", + "resolved": "https://registry.npmjs.org/webdriver/-/webdriver-9.0.7.tgz", + "integrity": "sha512-0PN4omqCGlgi3RG0LyrQXr0RUmlDCenNtpN+dfzikfYoV+CHiCw2GMnZp2XCuYUnU01MaCKgRQxLuGobyZov+A==", "dev": true, "dependencies": { "@types/node": "^20.1.0", "@types/ws": "^8.5.3", - "@wdio/config": "8.39.0", - "@wdio/logger": "8.38.0", - "@wdio/protocols": "8.38.0", - "@wdio/types": "8.39.0", - "@wdio/utils": "8.39.0", - "deepmerge-ts": "^5.1.0", - "got": "^12.6.1", - "ky": "^0.33.0", + "@wdio/config": "9.0.6", + "@wdio/logger": "9.0.4", + "@wdio/protocols": "9.0.4", + "@wdio/types": "9.0.4", + "@wdio/utils": "9.0.6", + "deepmerge-ts": "^7.0.3", "ws": "^8.8.0" }, "engines": { - "node": "^16.13 || >=18" + "node": ">=18" } }, "node_modules/webdriverio": { - "version": "8.39.0", - "resolved": "https://registry.npmjs.org/webdriverio/-/webdriverio-8.39.0.tgz", - "integrity": "sha512-pDpGu0V+TL1LkXPode67m3s+IPto4TcmcOzMpzFgu2oeLMBornoLN3yQSFR1fjZd1gK4UfnG3lJ4poTGOfbWfw==", + "version": "9.0.7", + "resolved": "https://registry.npmjs.org/webdriverio/-/webdriverio-9.0.7.tgz", + "integrity": "sha512-/6CvJkKpUWYbX/59PNJCHXGLPwulQ/bXZwlIUrsF6MWKdf8Eb6yTaXkMJBaBy5x496b50PQcXkbe+qpfsnqXsg==", "dev": true, "dependencies": { - "@types/node": "^20.1.0", - "@wdio/config": "8.39.0", - "@wdio/logger": "8.38.0", - "@wdio/protocols": "8.38.0", - "@wdio/repl": "8.24.12", - "@wdio/types": "8.39.0", - "@wdio/utils": "8.39.0", - "archiver": "^7.0.0", - "aria-query": "^5.0.0", + "@types/node": "^20.11.30", + "@types/sinonjs__fake-timers": "^8.1.5", + "@wdio/config": "9.0.6", + "@wdio/logger": "9.0.4", + "@wdio/protocols": "9.0.4", + "@wdio/repl": "9.0.4", + "@wdio/types": "9.0.4", + "@wdio/utils": "9.0.6", + "archiver": "^7.0.1", + "aria-query": "^5.3.0", + "cheerio": "^1.0.0-rc.12", "css-shorthand-properties": "^1.1.1", "css-value": "^0.0.1", - "devtools-protocol": "^0.0.1302984", - "grapheme-splitter": "^1.0.2", + "grapheme-splitter": "^1.0.4", + "htmlfy": "^0.2.1", "import-meta-resolve": "^4.0.0", "is-plain-obj": "^4.1.0", "jszip": "^3.10.1", "lodash.clonedeep": "^4.5.0", "lodash.zip": "^4.2.0", - "minimatch": "^9.0.0", - "puppeteer-core": "^20.9.0", - "query-selector-shadow-dom": "^1.0.0", - "resq": "^1.9.1", + "minimatch": "^9.0.3", + "query-selector-shadow-dom": "^1.0.1", + "resq": "^1.11.0", "rgb2hex": "0.2.5", - "serialize-error": "^11.0.1", - "webdriver": "8.39.0" + "serialize-error": "^11.0.3", + "urlpattern-polyfill": "^10.0.0", + "webdriver": "9.0.7" }, "engines": { - "node": "^16.13 || >=18" + "node": ">=18" }, "peerDependencies": { - "devtools": "^8.14.0" + "puppeteer-core": "^22.3.0" }, "peerDependenciesMeta": { - "devtools": { + "puppeteer-core": { "optional": true } } @@ -9411,22 +9145,6 @@ "node": ">=18" } }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dev": true, - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "node_modules/whatwg-url/node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "dev": true - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -9490,10 +9208,9 @@ "dev": true }, "node_modules/ws": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", - "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", - "dev": true, + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", "engines": { "node": ">=10.0.0" }, @@ -9648,7 +9365,7 @@ "node_modules/yauzl": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", + "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", "dev": true, "dependencies": { "buffer-crc32": "~0.2.3", diff --git a/package.json b/package.json index 84bf44b98..2ec843f3d 100644 --- a/package.json +++ b/package.json @@ -139,7 +139,7 @@ "readline-sync": "^1.4.10", "rimraf": "^5.0.0", "typescript": "^5.3.3", - "webdriverio": "^8.32.2", + "webdriverio": "^9.0.7", "yargs": "^17.2.1" }, "dependencies": { From 0a6596ce75a0a29f05cedbe718fda84fb601b4f1 Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Tue, 3 Sep 2024 09:17:42 -0700 Subject: [PATCH 45/90] feat: mark some marker_svg properties protected instead of private (#8558) --- core/renderers/common/marker_svg.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/renderers/common/marker_svg.ts b/core/renderers/common/marker_svg.ts index 927c377f4..057324f03 100644 --- a/core/renderers/common/marker_svg.ts +++ b/core/renderers/common/marker_svg.ts @@ -47,7 +47,7 @@ export class MarkerSvg { * The workspace, field, or block that the marker SVG element should be * attached to. */ - private parent: IASTNodeLocationSvg | null = null; + protected parent: IASTNodeLocationSvg | null = null; /** The current SVG element for the marker. */ currentMarkerSvg: SVGElement | null = null; @@ -73,9 +73,9 @@ export class MarkerSvg { * @param marker The marker to draw. */ constructor( - private readonly workspace: WorkspaceSvg, + protected readonly workspace: WorkspaceSvg, constants: ConstantProvider, - private readonly marker: Marker, + protected readonly marker: Marker, ) { this.constants_ = constants; @@ -223,7 +223,7 @@ export class MarkerSvg { * * @param curNode The node to draw the marker for. */ - private showWithBlockPrevOutput(curNode: ASTNode) { + protected showWithBlockPrevOutput(curNode: ASTNode) { const block = curNode.getSourceBlock() as BlockSvg; const width = block.width; const height = block.height; @@ -620,7 +620,7 @@ export class MarkerSvg { * @param oldNode The old node the marker used to be on. * @param curNode The new node the marker is currently on. */ - private fireMarkerEvent(oldNode: ASTNode, curNode: ASTNode) { + protected fireMarkerEvent(oldNode: ASTNode, curNode: ASTNode) { const curBlock = curNode.getSourceBlock(); const event = new (eventUtils.get(EventType.MARKER_MOVE))( curBlock, From 05795a06ea56ba5aa816c3025a967e36094e69c7 Mon Sep 17 00:00:00 2001 From: Ben Henning Date: Tue, 3 Sep 2024 23:13:50 +0000 Subject: [PATCH 46/90] Rename 'tidyUp' back to 'cleanUp'. --- core/contextmenu_items.ts | 2 +- core/workspace_svg.ts | 4 +-- .../workspacefactory/wfactory_controller.js | 6 ++--- tests/mocha/contextmenu_items_test.js | 6 ++--- tests/mocha/workspace_svg_test.js | 26 +++++++++---------- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/core/contextmenu_items.ts b/core/contextmenu_items.ts index 04b94eed7..25ffab59b 100644 --- a/core/contextmenu_items.ts +++ b/core/contextmenu_items.ts @@ -91,7 +91,7 @@ export function registerCleanup() { return 'hidden'; }, callback(scope: Scope) { - scope.workspace!.tidyUp(); + scope.workspace!.cleanUp(); }, scopeType: ContextMenuRegistry.ScopeType.WORKSPACE, id: 'cleanWorkspace', diff --git a/core/workspace_svg.ts b/core/workspace_svg.ts index d118c8584..b8ef96292 100644 --- a/core/workspace_svg.ts +++ b/core/workspace_svg.ts @@ -1645,8 +1645,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { return boundary; } - /** Tidy up the workspace by ordering all the blocks in a column such that none overlap. */ - tidyUp() { + /** Clean up the workspace by ordering all the blocks in a column such that none overlap. */ + cleanUp() { this.setResizesEnabled(false); eventUtils.setGroup(true); diff --git a/demos/blockfactory/workspacefactory/wfactory_controller.js b/demos/blockfactory/workspacefactory/wfactory_controller.js index 7e2f95c81..385feede8 100644 --- a/demos/blockfactory/workspacefactory/wfactory_controller.js +++ b/demos/blockfactory/workspacefactory/wfactory_controller.js @@ -278,7 +278,7 @@ WorkspaceFactoryController.prototype.clearAndLoadElement = function(id) { this.view.setCategoryTabSelection(id, true); // Order blocks as shown in flyout. - this.toolboxWorkspace.tidyUp(); + this.toolboxWorkspace.cleanUp(); // Update category editing buttons. this.view.updateState(this.model.getIndexByElementId @@ -774,7 +774,7 @@ WorkspaceFactoryController.prototype.importToolboxFromTree_ = function(tree) { // No categories present. // Load all the blocks into a single category evenly spaced. Blockly.Xml.domToWorkspace(tree, this.toolboxWorkspace); - this.toolboxWorkspace.tidyUp(); + this.toolboxWorkspace.cleanUp(); // Convert actual shadow blocks to user-generated shadow blocks. this.convertShadowBlocks(); @@ -799,7 +799,7 @@ WorkspaceFactoryController.prototype.importToolboxFromTree_ = function(tree) { } // Evenly space the blocks. - this.toolboxWorkspace.tidyUp(); + this.toolboxWorkspace.cleanUp(); // Convert actual shadow blocks to user-generated shadow blocks. this.convertShadowBlocks(); diff --git a/tests/mocha/contextmenu_items_test.js b/tests/mocha/contextmenu_items_test.js index ff6f4fe91..a9e2bb3de 100644 --- a/tests/mocha/contextmenu_items_test.js +++ b/tests/mocha/contextmenu_items_test.js @@ -123,7 +123,7 @@ suite('Context Menu Items', function () { suite('Cleanup', function () { setup(function () { this.cleanupOption = this.registry.getItem('cleanWorkspace'); - this.tidyUpStub = sinon.stub(this.workspace, 'tidyUp'); + this.cleanUpStub = sinon.stub(this.workspace, 'cleanUp'); }); test('Enabled when multiple blocks', function () { @@ -153,9 +153,9 @@ suite('Context Menu Items', function () { ); }); - test('Calls workspace tidyUp', function () { + test('Calls workspace cleanUp', function () { this.cleanupOption.callback(this.scope); - sinon.assert.calledOnce(this.tidyUpStub); + sinon.assert.calledOnce(this.cleanUpStub); }); test('Has correct label', function () { diff --git a/tests/mocha/workspace_svg_test.js b/tests/mocha/workspace_svg_test.js index d90c21106..75c0625fb 100644 --- a/tests/mocha/workspace_svg_test.js +++ b/tests/mocha/workspace_svg_test.js @@ -407,9 +407,9 @@ suite('WorkspaceSvg', function () { }); }); - suite('tidyUp', function () { + suite('cleanUp', function () { test('empty workspace does not change', function () { - this.workspace.tidyUp(); + this.workspace.cleanUp(); const blocks = this.workspace.getTopBlocks(true); assert.equal(blocks.length, 0, 'workspace is empty'); @@ -426,7 +426,7 @@ suite('WorkspaceSvg', function () { }; Blockly.serialization.blocks.append(blockJson, this.workspace); - this.workspace.tidyUp(); + this.workspace.cleanUp(); const blocks = this.workspace.getTopBlocks(true); const origin = new Blockly.utils.Coordinate(0, 0); @@ -449,7 +449,7 @@ suite('WorkspaceSvg', function () { }; Blockly.serialization.blocks.append(blockJson, this.workspace); - this.workspace.tidyUp(); + this.workspace.cleanUp(); const topBlocks = this.workspace.getTopBlocks(true); const allBlocks = this.workspace.getAllBlocks(false); @@ -483,7 +483,7 @@ suite('WorkspaceSvg', function () { }; Blockly.serialization.blocks.append(blockJson, this.workspace); - this.workspace.tidyUp(); + this.workspace.cleanUp(); const topBlocks = this.workspace.getTopBlocks(true); const allBlocks = this.workspace.getAllBlocks(false); @@ -516,7 +516,7 @@ suite('WorkspaceSvg', function () { Blockly.serialization.blocks.append(blockJson1, this.workspace); Blockly.serialization.blocks.append(blockJson2, this.workspace); - this.workspace.tidyUp(); + this.workspace.cleanUp(); // block1 and block2 do not switch places since blocks are pre-sorted by their position before // being tidied up, so the order they were added to the workspace doesn't matter. @@ -557,7 +557,7 @@ suite('WorkspaceSvg', function () { Blockly.serialization.blocks.append(blockJson1, this.workspace); Blockly.serialization.blocks.append(blockJson2, this.workspace); - this.workspace.tidyUp(); + this.workspace.cleanUp(); const topBlocks = this.workspace.getTopBlocks(true); const block1 = this.workspace.getBlockById('block1'); @@ -598,7 +598,7 @@ suite('WorkspaceSvg', function () { this.workspace.getGrid().setSpacing(20); this.workspace.getGrid().setSnapToGrid(true); - this.workspace.tidyUp(); + this.workspace.cleanUp(); const topBlocks = this.workspace.getTopBlocks(true); const block1 = this.workspace.getBlockById('block1'); @@ -644,7 +644,7 @@ suite('WorkspaceSvg', function () { Blockly.serialization.blocks.append(blockJson1, this.workspace); Blockly.serialization.blocks.append(blockJson2, this.workspace); - this.workspace.tidyUp(); + this.workspace.cleanUp(); const topBlocks = this.workspace.getTopBlocks(true); const allBlocks = this.workspace.getAllBlocks(false); @@ -733,7 +733,7 @@ suite('WorkspaceSvg', function () { Blockly.serialization.blocks.append(blockJson1, this.workspace); Blockly.serialization.blocks.append(blockJson2, this.workspace); - this.workspace.tidyUp(); + this.workspace.cleanUp(); const topBlocks = this.workspace.getTopBlocks(true); const block1 = this.workspace.getBlockById('block1'); @@ -773,7 +773,7 @@ suite('WorkspaceSvg', function () { Blockly.serialization.blocks.append(blockJson4, this.workspace); Blockly.serialization.blocks.append(blockJson5, this.workspace); - this.workspace.tidyUp(); + this.workspace.cleanUp(); const topBlocks = this.workspace.getTopBlocks(true); const block1Pos = this.workspace @@ -816,7 +816,7 @@ suite('WorkspaceSvg', function () { }; Blockly.serialization.blocks.append(blockJson, this.workspace); - this.workspace.tidyUp(); + this.workspace.cleanUp(); const topBlocks = this.workspace.getTopBlocks(true); const allBlocks = this.workspace.getAllBlocks(false); @@ -907,7 +907,7 @@ suite('WorkspaceSvg', function () { Blockly.serialization.blocks.append(blockJson4, this.workspace); Blockly.serialization.blocks.append(blockJson5, this.workspace); - this.workspace.tidyUp(); + this.workspace.cleanUp(); const topBlocks = this.workspace.getTopBlocks(true); const block1Rect = this.workspace From 63158b6c8e28eaf5c9171d349b125940b07e3d93 Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Wed, 4 Sep 2024 09:11:15 -0700 Subject: [PATCH 47/90] release: Update version number to 11.2.0-beta.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4d8de7dba..ba2b59f20 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "blockly", - "version": "11.1.1", + "version": "11.2.0-beta.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "blockly", - "version": "11.1.1", + "version": "11.2.0-beta.0", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index 2ec843f3d..5066fa1f1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "blockly", - "version": "11.1.1", + "version": "11.2.0-beta.0", "description": "Blockly is a library for building visual programming editors.", "keywords": [ "blockly" From 483f8fb65b7f24e0ccd48ddd423af2b1b12c6c00 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2024 08:28:01 -0700 Subject: [PATCH 48/90] chore(deps): bump @typescript-eslint/eslint-plugin from 8.1.0 to 8.4.0 (#8567) Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 8.1.0 to 8.4.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.4.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 103 ++++++++++++++++++++-------------------------- 1 file changed, 45 insertions(+), 58 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4d8de7dba..9a6fcca2c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1242,17 +1242,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.1.0.tgz", - "integrity": "sha512-LlNBaHFCEBPHyD4pZXb35mzjGkuGKXU5eeCA1SxvHfiRES0E82dOounfVpL4DCqYvJEKab0bZIA0gCRpdLKkCw==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.4.0.tgz", + "integrity": "sha512-rg8LGdv7ri3oAlenMACk9e+AR4wUV0yrrG+XKsGKOK0EVgeEDqurkXMPILG2836fW4ibokTB5v4b6Z9+GYQDEw==", "dev": true, - "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.1.0", - "@typescript-eslint/type-utils": "8.1.0", - "@typescript-eslint/utils": "8.1.0", - "@typescript-eslint/visitor-keys": "8.1.0", + "@typescript-eslint/scope-manager": "8.4.0", + "@typescript-eslint/type-utils": "8.4.0", + "@typescript-eslint/utils": "8.4.0", + "@typescript-eslint/visitor-keys": "8.4.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -1415,14 +1414,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.1.0.tgz", - "integrity": "sha512-DsuOZQji687sQUjm4N6c9xABJa7fjvfIdjqpSIIVOgaENf2jFXiM9hIBZOL3hb6DHK9Nvd2d7zZnoMLf9e0OtQ==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.4.0.tgz", + "integrity": "sha512-n2jFxLeY0JmKfUqy3P70rs6vdoPjHK8P/w+zJcV3fk0b0BwRXC/zxRTEnAsgYT7MwdQDt/ZEbtdzdVC+hcpF0A==", "dev": true, - "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.1.0", - "@typescript-eslint/visitor-keys": "8.1.0" + "@typescript-eslint/types": "8.4.0", + "@typescript-eslint/visitor-keys": "8.4.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1433,11 +1431,10 @@ } }, "node_modules/@typescript-eslint/scope-manager/node_modules/@typescript-eslint/types": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.1.0.tgz", - "integrity": "sha512-q2/Bxa0gMOu/2/AKALI0tCKbG2zppccnRIRCW6BaaTlRVaPKft4oVYPp7WOPpcnsgbr0qROAVCVKCvIQ0tbWog==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.4.0.tgz", + "integrity": "sha512-T1RB3KQdskh9t3v/qv7niK6P8yvn7ja1mS7QK7XfRVL6wtZ8/mFs/FHf4fKvTA0rKnqnYxl/uHFNbnEt0phgbw==", "dev": true, - "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -1447,14 +1444,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.1.0.tgz", - "integrity": "sha512-oLYvTxljVvsMnldfl6jIKxTaU7ok7km0KDrwOt1RHYu6nxlhN3TIx8k5Q52L6wR33nOwDgM7VwW1fT1qMNfFIA==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.4.0.tgz", + "integrity": "sha512-pu2PAmNrl9KX6TtirVOrbLPLwDmASpZhK/XU7WvoKoCUkdtq9zF7qQ7gna0GBZFN0hci0vHaSusiL2WpsQk37A==", "dev": true, - "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "8.1.0", - "@typescript-eslint/utils": "8.1.0", + "@typescript-eslint/typescript-estree": "8.4.0", + "@typescript-eslint/utils": "8.4.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -1486,16 +1482,15 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.1.0.tgz", - "integrity": "sha512-NTHhmufocEkMiAord/g++gWKb0Fr34e9AExBRdqgWdVBaKoei2dIyYKD9Q0jBnvfbEA5zaf8plUFMUH6kQ0vGg==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.4.0.tgz", + "integrity": "sha512-kJ2OIP4dQw5gdI4uXsaxUZHRwWAGpREJ9Zq6D5L0BweyOrWsL6Sz0YcAZGWhvKnH7fm1J5YFE1JrQL0c9dd53A==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "8.1.0", - "@typescript-eslint/visitor-keys": "8.1.0", + "@typescript-eslint/types": "8.4.0", + "@typescript-eslint/visitor-keys": "8.4.0", "debug": "^4.3.4", - "globby": "^11.1.0", + "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", @@ -1515,11 +1510,10 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/types": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.1.0.tgz", - "integrity": "sha512-q2/Bxa0gMOu/2/AKALI0tCKbG2zppccnRIRCW6BaaTlRVaPKft4oVYPp7WOPpcnsgbr0qROAVCVKCvIQ0tbWog==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.4.0.tgz", + "integrity": "sha512-T1RB3KQdskh9t3v/qv7niK6P8yvn7ja1mS7QK7XfRVL6wtZ8/mFs/FHf4fKvTA0rKnqnYxl/uHFNbnEt0phgbw==", "dev": true, - "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -1533,7 +1527,6 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, - "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } @@ -1543,7 +1536,6 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, - "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -1559,7 +1551,6 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -1568,16 +1559,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.1.0.tgz", - "integrity": "sha512-ypRueFNKTIFwqPeJBfeIpxZ895PQhNyH4YID6js0UoBImWYoSjBsahUn9KMiJXh94uOjVBgHD9AmkyPsPnFwJA==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.4.0.tgz", + "integrity": "sha512-swULW8n1IKLjRAgciCkTCafyTHHfwVQFt8DovmaF69sKbOxTSFMmIZaSHjqO9i/RV0wIblaawhzvtva8Nmm7lQ==", "dev": true, - "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.1.0", - "@typescript-eslint/types": "8.1.0", - "@typescript-eslint/typescript-estree": "8.1.0" + "@typescript-eslint/scope-manager": "8.4.0", + "@typescript-eslint/types": "8.4.0", + "@typescript-eslint/typescript-estree": "8.4.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1591,11 +1581,10 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/types": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.1.0.tgz", - "integrity": "sha512-q2/Bxa0gMOu/2/AKALI0tCKbG2zppccnRIRCW6BaaTlRVaPKft4oVYPp7WOPpcnsgbr0qROAVCVKCvIQ0tbWog==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.4.0.tgz", + "integrity": "sha512-T1RB3KQdskh9t3v/qv7niK6P8yvn7ja1mS7QK7XfRVL6wtZ8/mFs/FHf4fKvTA0rKnqnYxl/uHFNbnEt0phgbw==", "dev": true, - "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -1605,13 +1594,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.1.0.tgz", - "integrity": "sha512-ba0lNI19awqZ5ZNKh6wCModMwoZs457StTebQ0q1NP58zSi2F6MOZRXwfKZy+jB78JNJ/WH8GSh2IQNzXX8Nag==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.4.0.tgz", + "integrity": "sha512-zTQD6WLNTre1hj5wp09nBIDiOc2U5r/qmzo7wxPn4ZgAjHql09EofqhF9WF+fZHzL5aCyaIpPcT2hyxl73kr9A==", "dev": true, - "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.1.0", + "@typescript-eslint/types": "8.4.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { @@ -1623,11 +1611,10 @@ } }, "node_modules/@typescript-eslint/visitor-keys/node_modules/@typescript-eslint/types": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.1.0.tgz", - "integrity": "sha512-q2/Bxa0gMOu/2/AKALI0tCKbG2zppccnRIRCW6BaaTlRVaPKft4oVYPp7WOPpcnsgbr0qROAVCVKCvIQ0tbWog==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.4.0.tgz", + "integrity": "sha512-T1RB3KQdskh9t3v/qv7niK6P8yvn7ja1mS7QK7XfRVL6wtZ8/mFs/FHf4fKvTA0rKnqnYxl/uHFNbnEt0phgbw==", "dev": true, - "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, From 8211c1a530fc827354c648c08f640f8fec90eff1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Sep 2024 17:58:59 +0100 Subject: [PATCH 49/90] chore(deps): bump @hyperjump/browser from 1.1.4 to 1.1.6 (#8569) Bumps [@hyperjump/browser](https://github.com/hyperjump-io/browser) from 1.1.4 to 1.1.6. - [Commits](https://github.com/hyperjump-io/browser/compare/v1.1.4...v1.1.6) --- updated-dependencies: - dependency-name: "@hyperjump/browser" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9a6fcca2c..c00d0fe11 100644 --- a/package-lock.json +++ b/package-lock.json @@ -472,11 +472,10 @@ "dev": true }, "node_modules/@hyperjump/browser": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@hyperjump/browser/-/browser-1.1.4.tgz", - "integrity": "sha512-85rfa3B79MssMOxNChvXJhfgvIXqA2FEzwrxKe9iMpCKZVQIxQe54w210VeFM0D33pVOeNskg7TyptSjenY2+w==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@hyperjump/browser/-/browser-1.1.6.tgz", + "integrity": "sha512-i27uPV7SxK1GOn7TLTRxTorxchYa5ur9JHgtl6TxZ1MHuyb9ROAnXxEeu4q4H1836Xb7lL2PGPsaa5Jl3p+R6g==", "dev": true, - "license": "MIT", "dependencies": { "@hyperjump/json-pointer": "^1.1.0", "@hyperjump/uri": "^1.2.0", From 561b4189fb2fe186a91eb27d9cfbdffc41782367 Mon Sep 17 00:00:00 2001 From: John Nesky Date: Fri, 13 Sep 2024 12:53:37 -0700 Subject: [PATCH 50/90] fix: Factor out workspace drag methods into utils. (#8566) --- core/bubbles/textinput_bubble.ts | 6 ++- core/comments/comment_view.ts | 8 ++-- core/utils/drag.ts | 74 ++++++++++++++++++++++++++++++++ core/workspace_svg.ts | 25 ++--------- 4 files changed, 85 insertions(+), 28 deletions(-) create mode 100644 core/utils/drag.ts diff --git a/core/bubbles/textinput_bubble.ts b/core/bubbles/textinput_bubble.ts index 675dbb539..befbb2f21 100644 --- a/core/bubbles/textinput_bubble.ts +++ b/core/bubbles/textinput_bubble.ts @@ -9,6 +9,7 @@ import * as touch from '../touch.js'; import {browserEvents} from '../utils.js'; import {Coordinate} from '../utils/coordinate.js'; import * as dom from '../utils/dom.js'; +import * as drag from '../utils/drag.js'; import {Rect} from '../utils/rect.js'; import {Size} from '../utils/size.js'; import {Svg} from '../utils/svg.js'; @@ -224,7 +225,8 @@ export class TextInputBubble extends Bubble { return; } - this.workspace.startDrag( + drag.start( + this.workspace, e, new Coordinate( this.workspace.RTL ? -this.getSize().width : this.getSize().width, @@ -264,7 +266,7 @@ export class TextInputBubble extends Bubble { /** Handles pointer move events on the resize target. */ private onResizePointerMove(e: PointerEvent) { - const delta = this.workspace.moveDrag(e); + const delta = drag.move(this.workspace, e); this.setSize( new Size(this.workspace.RTL ? -delta.x : delta.x, delta.y), false, diff --git a/core/comments/comment_view.ts b/core/comments/comment_view.ts index 72f72fa38..bd90c7576 100644 --- a/core/comments/comment_view.ts +++ b/core/comments/comment_view.ts @@ -11,6 +11,7 @@ import * as layers from '../layers.js'; import * as touch from '../touch.js'; import {Coordinate} from '../utils/coordinate.js'; import * as dom from '../utils/dom.js'; +import * as drag from '../utils/drag.js'; import {Size} from '../utils/size.js'; import {Svg} from '../utils/svg.js'; import {WorkspaceSvg} from '../workspace_svg.js'; @@ -524,8 +525,8 @@ export class CommentView implements IRenderedElement { this.preResizeSize = this.getSize(); - // TODO(#7926): Move this into a utils file. - this.workspace.startDrag( + drag.start( + this.workspace, e, new Coordinate( this.workspace.RTL ? -this.getSize().width : this.getSize().width, @@ -569,8 +570,7 @@ export class CommentView implements IRenderedElement { /** Resizes the comment in response to a drag on the resize handle. */ private onResizePointerMove(e: PointerEvent) { - // TODO(#7926): Move this into a utils file. - const size = this.workspace.moveDrag(e); + const size = drag.move(this.workspace, e); this.setSizeWithoutFiringEvents( new Size(this.workspace.RTL ? -size.x : size.x, size.y), ); diff --git a/core/utils/drag.ts b/core/utils/drag.ts new file mode 100644 index 000000000..a6322933b --- /dev/null +++ b/core/utils/drag.ts @@ -0,0 +1,74 @@ +/** + * @license + * Copyright 2024 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as browserEvents from '../browser_events.js'; +import type {WorkspaceSvg} from '../workspace_svg.js'; +import {Coordinate} from './coordinate.js'; + +const workspaceToDragDelta: WeakMap = new WeakMap(); + +/** + * Convert from mouse coordinates to workspace coordinates. + * + * @param workspace The workspace where the pointer event is occurring. + * @param e The pointer event with the source coordinates. + */ +function mouseToWorkspacePoint( + workspace: WorkspaceSvg, + e: PointerEvent, +): SVGPoint { + const point = browserEvents.mouseToSvg( + e, + workspace.getParentSvg(), + workspace.getInverseScreenCTM(), + ); + // Fix scale of mouse event. + point.x /= workspace.scale; + point.y /= workspace.scale; + return point; +} + +/** + * Start tracking a drag of an object on this workspace by recording the offset + * between the pointer's current location and the object's starting location. + * + * Used for resizing block comments and workspace comments. + * + * @param workspace The workspace where the drag is occurring. + * @param e Pointer down event. + * @param xy Starting location of object. + */ +export function start( + workspace: WorkspaceSvg, + e: PointerEvent, + xy: Coordinate, +) { + const point = mouseToWorkspacePoint(workspace, e); + // Record the starting offset between the bubble's location and the mouse. + workspaceToDragDelta.set(workspace, Coordinate.difference(xy, point)); +} + +/** + * Compute the new position of a dragged object in this workspace based on the + * current pointer position and the offset between the pointer's starting + * location and the object's starting location. + * + * The start function should have be called previously, when the drag started. + * + * Used for resizing block comments and workspace comments. + * + * @param workspace The workspace where the drag is occurring. + * @param e Pointer move event. + * @returns New location of object. + */ +export function move(workspace: WorkspaceSvg, e: PointerEvent): Coordinate { + const point = mouseToWorkspacePoint(workspace, e); + const dragDelta = workspaceToDragDelta.get(workspace); + if (!dragDelta) { + throw new Error('Drag not initialized'); + } + return Coordinate.sum(dragDelta, point); +} diff --git a/core/workspace_svg.ts b/core/workspace_svg.ts index b8ef96292..fed5e3cb1 100644 --- a/core/workspace_svg.ts +++ b/core/workspace_svg.ts @@ -63,6 +63,7 @@ import type {Trashcan} from './trashcan.js'; import * as arrayUtils from './utils/array.js'; import {Coordinate} from './utils/coordinate.js'; import * as dom from './utils/dom.js'; +import * as drag from './utils/drag.js'; import type {Metrics} from './utils/metrics.js'; import {Rect} from './utils/rect.js'; import {Size} from './utils/size.js'; @@ -181,9 +182,6 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** Vertical scroll value when scrolling started in pixel units. */ startScrollY = 0; - /** Distance from mouse to object being dragged. */ - private dragDeltaXY: Coordinate | null = null; - /** Current scale. */ scale = 1; @@ -1447,16 +1445,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { * @param xy Starting location of object. */ startDrag(e: PointerEvent, xy: Coordinate) { - // Record the starting offset between the bubble's location and the mouse. - const point = browserEvents.mouseToSvg( - e, - this.getParentSvg(), - this.getInverseScreenCTM(), - ); - // Fix scale of mouse event. - point.x /= this.scale; - point.y /= this.scale; - this.dragDeltaXY = Coordinate.difference(xy, point); + drag.start(this, e, xy); } /** @@ -1466,15 +1455,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { * @returns New location of object. */ moveDrag(e: PointerEvent): Coordinate { - const point = browserEvents.mouseToSvg( - e, - this.getParentSvg(), - this.getInverseScreenCTM(), - ); - // Fix scale of mouse event. - point.x /= this.scale; - point.y /= this.scale; - return Coordinate.sum(this.dragDeltaXY!, point); + return drag.move(this, e); } /** From de6982abd2cd15b9843fee82e46d3dcc2f741c5a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 08:21:11 -0700 Subject: [PATCH 51/90] chore(deps): bump @microsoft/api-documenter from 7.25.10 to 7.25.14 (#8578) Bumps [@microsoft/api-documenter](https://github.com/microsoft/rushstack/tree/HEAD/apps/api-documenter) from 7.25.10 to 7.25.14. - [Changelog](https://github.com/microsoft/rushstack/blob/main/apps/api-documenter/CHANGELOG.md) - [Commits](https://github.com/microsoft/rushstack/commits/@microsoft/api-documenter_v7.25.14/apps/api-documenter) --- updated-dependencies: - dependency-name: "@microsoft/api-documenter" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/package-lock.json b/package-lock.json index c00d0fe11..cc2b59a4b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -630,16 +630,16 @@ } }, "node_modules/@microsoft/api-documenter": { - "version": "7.25.10", - "resolved": "https://registry.npmjs.org/@microsoft/api-documenter/-/api-documenter-7.25.10.tgz", - "integrity": "sha512-GYc5AALrP9gxYPpkPc/BXXdekg+Ge8p9yyO1aRVwJDGzCXR7XRUvh6gc2jay/DmBx4KfyMx0LFWJ0HcUXudqgQ==", + "version": "7.25.14", + "resolved": "https://registry.npmjs.org/@microsoft/api-documenter/-/api-documenter-7.25.14.tgz", + "integrity": "sha512-nysAB+j4l5Al3XvCdee6tw0rw4fXpnlIq9En2opcc3DgITeoehiaYYoZZqoqOQSKlSUDWF7Z55GGsvntVrcBkg==", "dev": true, "dependencies": { - "@microsoft/api-extractor-model": "7.29.4", + "@microsoft/api-extractor-model": "7.29.8", "@microsoft/tsdoc": "~0.15.0", - "@rushstack/node-core-library": "5.5.1", - "@rushstack/terminal": "0.13.3", - "@rushstack/ts-command-line": "4.22.4", + "@rushstack/node-core-library": "5.9.0", + "@rushstack/terminal": "0.14.2", + "@rushstack/ts-command-line": "4.22.8", "js-yaml": "~3.13.1", "resolve": "~1.22.1" }, @@ -648,20 +648,20 @@ } }, "node_modules/@microsoft/api-documenter/node_modules/@microsoft/api-extractor-model": { - "version": "7.29.4", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.29.4.tgz", - "integrity": "sha512-LHOMxmT8/tU1IiiiHOdHFF83Qsi+V8d0kLfscG4EvQE9cafiR8blOYr8SfkQKWB1wgEilQgXJX3MIA4vetDLZw==", + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.29.8.tgz", + "integrity": "sha512-t3Z/xcO6TRbMcnKGVMs4uMzv/gd5j0NhMiJIGjD4cJMeFJ1Hf8wnLSx37vxlRlL0GWlGJhnFgxvnaL6JlS+73g==", "dev": true, "dependencies": { "@microsoft/tsdoc": "~0.15.0", "@microsoft/tsdoc-config": "~0.17.0", - "@rushstack/node-core-library": "5.5.1" + "@rushstack/node-core-library": "5.9.0" } }, "node_modules/@microsoft/api-documenter/node_modules/@rushstack/node-core-library": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-5.5.1.tgz", - "integrity": "sha512-ZutW56qIzH8xIOlfyaLQJFx+8IBqdbVCZdnj+XT1MorQ1JqqxHse8vbCpEM+2MjsrqcbxcgDIbfggB1ZSQ2A3g==", + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-5.9.0.tgz", + "integrity": "sha512-MMsshEWkTbXqxqFxD4gcIUWQOCeBChlGczdZbHfqmNZQFLHB3yWxDFSMHFUdu2/OB9NUk7Awn5qRL+rws4HQNg==", "dev": true, "dependencies": { "ajv": "~8.13.0", @@ -683,12 +683,12 @@ } }, "node_modules/@microsoft/api-documenter/node_modules/@rushstack/terminal": { - "version": "0.13.3", - "resolved": "https://registry.npmjs.org/@rushstack/terminal/-/terminal-0.13.3.tgz", - "integrity": "sha512-fc3zjXOw8E0pXS5t9vTiIPx9gHA0fIdTXsu9mT4WbH+P3mYvnrX0iAQ5a6NvyK1+CqYWBTw/wVNx7SDJkI+WYQ==", + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/@rushstack/terminal/-/terminal-0.14.2.tgz", + "integrity": "sha512-2fC1wqu1VCExKC0/L+0noVcFQEXEnoBOtCIex1TOjBzEDWcw8KzJjjj7aTP6mLxepG0XIyn9OufeFb6SFsa+sg==", "dev": true, "dependencies": { - "@rushstack/node-core-library": "5.5.1", + "@rushstack/node-core-library": "5.9.0", "supports-color": "~8.1.1" }, "peerDependencies": { @@ -701,12 +701,12 @@ } }, "node_modules/@microsoft/api-documenter/node_modules/@rushstack/ts-command-line": { - "version": "4.22.4", - "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.22.4.tgz", - "integrity": "sha512-QoyhbWfyF9Ixg5DWdPzxO3h2RmJ7i5WH9b7qLzD5h5WFya/ZqicjdPrVwQiGtrFvAbBj8jhcC9DhbzU9xAk78g==", + "version": "4.22.8", + "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.22.8.tgz", + "integrity": "sha512-XbFjOoV7qZHJnSuFUHv0pKaFA4ixyCuki+xMjsMfDwfvQjs5MYG0IK5COal3tRnG7KCDe2l/G+9LrzYE/RJhgg==", "dev": true, "dependencies": { - "@rushstack/terminal": "0.13.3", + "@rushstack/terminal": "0.14.2", "@types/argparse": "1.0.38", "argparse": "~1.0.9", "string-argv": "~0.3.1" From 73416d4db559302d2b090d112e1c74612910445a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 13:30:19 -0700 Subject: [PATCH 52/90] chore(deps): bump @typescript-eslint/parser from 8.2.0 to 8.5.0 (#8577) Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 8.2.0 to 8.5.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.5.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 114 ++++++++++------------------------------------ 1 file changed, 25 insertions(+), 89 deletions(-) diff --git a/package-lock.json b/package-lock.json index cc2b59a4b..7e34a9307 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1274,15 +1274,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.2.0.tgz", - "integrity": "sha512-j3Di+o0lHgPrb7FxL3fdEy6LJ/j2NE8u+AP/5cQ9SKb+JLH6V6UHDqJ+e0hXBkHP1wn1YDFjYCS9LBQsZDlDEg==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.5.0.tgz", + "integrity": "sha512-gF77eNv0Xz2UJg/NbpWJ0kqAm35UMsvZf1GHj8D9MRFTj/V3tAciIWXfmPLsAAF/vUlpWPvUDyH1jjsr0cMVWw==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "8.2.0", - "@typescript-eslint/types": "8.2.0", - "@typescript-eslint/typescript-estree": "8.2.0", - "@typescript-eslint/visitor-keys": "8.2.0", + "@typescript-eslint/scope-manager": "8.5.0", + "@typescript-eslint/types": "8.5.0", + "@typescript-eslint/typescript-estree": "8.5.0", + "@typescript-eslint/visitor-keys": "8.5.0", "debug": "^4.3.4" }, "engines": { @@ -1302,13 +1302,13 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.2.0.tgz", - "integrity": "sha512-OFn80B38yD6WwpoHU2Tz/fTz7CgFqInllBoC3WP+/jLbTb4gGPTy9HBSTsbDWkMdN55XlVU0mMDYAtgvlUspGw==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.5.0.tgz", + "integrity": "sha512-06JOQ9Qgj33yvBEx6tpC8ecP9o860rsR22hWMEd12WcTRrfaFgHr2RB/CA/B+7BMhHkXT4chg2MyboGdFGawYg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.2.0", - "@typescript-eslint/visitor-keys": "8.2.0" + "@typescript-eslint/types": "8.5.0", + "@typescript-eslint/visitor-keys": "8.5.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1319,9 +1319,9 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.2.0.tgz", - "integrity": "sha512-6a9QSK396YqmiBKPkJtxsgZZZVjYQ6wQ/TlI0C65z7vInaETuC6HAHD98AGLC8DyIPqHytvNuS8bBVvNLKyqvQ==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.5.0.tgz", + "integrity": "sha512-qjkormnQS5wF9pjSi6q60bKUHH44j2APxfh9TQRXK8wbYVeDYYdYJGIROL87LGZZ2gz3Rbmjc736qyL8deVtdw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1332,15 +1332,15 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.2.0.tgz", - "integrity": "sha512-kiG4EDUT4dImplOsbh47B1QnNmXSoUqOjWDvCJw/o8LgfD0yr7k2uy54D5Wm0j4t71Ge1NkynGhpWdS0dEIAUA==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.5.0.tgz", + "integrity": "sha512-vEG2Sf9P8BPQ+d0pxdfndw3xIXaoSjliG0/Ejk7UggByZPKXmJmw3GW5jV2gHNQNawBUyfahoSiCFVov0Ruf7Q==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.2.0", - "@typescript-eslint/visitor-keys": "8.2.0", + "@typescript-eslint/types": "8.5.0", + "@typescript-eslint/visitor-keys": "8.5.0", "debug": "^4.3.4", - "globby": "^11.1.0", + "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", @@ -1360,12 +1360,12 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.2.0.tgz", - "integrity": "sha512-sbgsPMW9yLvS7IhCi8IpuK1oBmtbWUNP+hBdwl/I9nzqVsszGnNGti5r9dUtF5RLivHUFFIdRvLiTsPhzSyJ3Q==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.5.0.tgz", + "integrity": "sha512-yTPqMnbAZJNy2Xq2XU8AdtOW9tJIr+UQb64aXB9f3B1498Zx9JorVgFJcZpEc9UBuCCrdzKID2RGAMkYcDtZOw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.2.0", + "@typescript-eslint/types": "8.5.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { @@ -2191,16 +2191,6 @@ "node": ">=0.10.0" } }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/assertion-error": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", @@ -3412,19 +3402,6 @@ "node": ">=0.3.1" } }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "license": "MIT", - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -4825,27 +4802,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "license": "MIT", - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/glogg": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/glogg/-/glogg-2.2.0.tgz", @@ -7269,16 +7225,6 @@ "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", "dev": true }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/pathval": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", @@ -8039,16 +7985,6 @@ "node": ">=0.3.1" } }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/slashes": { "version": "3.0.12", "resolved": "https://registry.npmjs.org/slashes/-/slashes-3.0.12.tgz", From 51f6dab0b26256510f3967131a8175eb6cd83a25 Mon Sep 17 00:00:00 2001 From: John Nesky Date: Fri, 20 Sep 2024 14:46:06 -0700 Subject: [PATCH 53/90] fix: Simplify list and text WHERE validation (#8575) * fix: Simplify list and text WHERE validation * Addressing PR review comments. --- blocks/lists.ts | 139 +++++++++++++++++++++--------------------------- blocks/text.ts | 54 +++++++++---------- 2 files changed, 86 insertions(+), 107 deletions(-) diff --git a/blocks/lists.ts b/blocks/lists.ts index 28ff17b3d..6754b6847 100644 --- a/blocks/lists.ts +++ b/blocks/lists.ts @@ -412,6 +412,24 @@ const LISTS_GETINDEX = { this.appendDummyInput() .appendField(modeMenu, 'MODE') .appendField('', 'SPACE'); + const menu = fieldRegistry.fromJson({ + type: 'field_dropdown', + options: this.WHERE_OPTIONS, + }) as FieldDropdown; + menu.setValidator( + /** @param value The input value. */ + function (this: FieldDropdown, value: string) { + const oldValue: string | null = this.getValue(); + const oldAt = oldValue === 'FROM_START' || oldValue === 'FROM_END'; + const newAt = value === 'FROM_START' || value === 'FROM_END'; + if (newAt !== oldAt) { + const block = this.getSourceBlock() as GetIndexBlock; + block.updateAt_(newAt); + } + return undefined; + }, + ); + this.appendDummyInput().appendField(menu, 'WHERE'); this.appendDummyInput('AT'); if (Msg['LISTS_GET_INDEX_TAIL']) { this.appendDummyInput('TAIL').appendField(Msg['LISTS_GET_INDEX_TAIL']); @@ -577,31 +595,6 @@ const LISTS_GETINDEX = { } else { this.appendDummyInput('AT'); } - const menu = fieldRegistry.fromJson({ - type: 'field_dropdown', - options: this.WHERE_OPTIONS, - }) as FieldDropdown; - menu.setValidator( - /** - * @param value The input value. - * @returns Null if the field has been replaced; otherwise undefined. - */ - function (this: FieldDropdown, value: string) { - const newAt = value === 'FROM_START' || value === 'FROM_END'; - // The 'isAt' variable is available due to this function being a - // closure. - if (newAt !== isAt) { - const block = this.getSourceBlock() as GetIndexBlock; - block.updateAt_(newAt); - // This menu has been destroyed and replaced. Update the - // replacement. - block.setFieldValue(value, 'WHERE'); - return null; - } - return undefined; - }, - ); - this.getInput('AT')!.appendField(menu, 'WHERE'); if (Msg['LISTS_GET_INDEX_TAIL']) { this.moveInputBefore('TAIL', null); } @@ -644,6 +637,24 @@ const LISTS_SETINDEX = { this.appendDummyInput() .appendField(operationDropdown, 'MODE') .appendField('', 'SPACE'); + const menu = fieldRegistry.fromJson({ + type: 'field_dropdown', + options: this.WHERE_OPTIONS, + }) as FieldDropdown; + menu.setValidator( + /** @param value The input value. */ + function (this: FieldDropdown, value: string) { + const oldValue: string | null = this.getValue(); + const oldAt = oldValue === 'FROM_START' || oldValue === 'FROM_END'; + const newAt = value === 'FROM_START' || value === 'FROM_END'; + if (newAt !== oldAt) { + const block = this.getSourceBlock() as SetIndexBlock; + block.updateAt_(newAt); + } + return undefined; + }, + ); + this.appendDummyInput().appendField(menu, 'WHERE'); this.appendDummyInput('AT'); this.appendValueInput('TO').appendField(Msg['LISTS_SET_INDEX_INPUT_TO']); this.setInputsInline(true); @@ -756,36 +767,10 @@ const LISTS_SETINDEX = { } else { this.appendDummyInput('AT'); } - const menu = fieldRegistry.fromJson({ - type: 'field_dropdown', - options: this.WHERE_OPTIONS, - }) as FieldDropdown; - menu.setValidator( - /** - * @param value The input value. - * @returns Null if the field has been replaced; otherwise undefined. - */ - function (this: FieldDropdown, value: string) { - const newAt = value === 'FROM_START' || value === 'FROM_END'; - // The 'isAt' variable is available due to this function being a - // closure. - if (newAt !== isAt) { - const block = this.getSourceBlock() as SetIndexBlock; - block.updateAt_(newAt); - // This menu has been destroyed and replaced. Update the - // replacement. - block.setFieldValue(value, 'WHERE'); - return null; - } - return undefined; - }, - ); this.moveInputBefore('AT', 'TO'); if (this.getInput('ORDINAL')) { this.moveInputBefore('ORDINAL', 'TO'); } - - this.getInput('AT')!.appendField(menu, 'WHERE'); }, }; blocks['lists_setIndex'] = LISTS_SETINDEX; @@ -818,7 +803,30 @@ const LISTS_GETSUBLIST = { this.appendValueInput('LIST') .setCheck('Array') .appendField(Msg['LISTS_GET_SUBLIST_INPUT_IN_LIST']); + const createMenu = (n: 1 | 2): FieldDropdown => { + const menu = fieldRegistry.fromJson({ + type: 'field_dropdown', + options: + this[('WHERE_OPTIONS_' + n) as 'WHERE_OPTIONS_1' | 'WHERE_OPTIONS_2'], + }) as FieldDropdown; + menu.setValidator( + /** @param value The input value. */ + function (this: FieldDropdown, value: string) { + const oldValue: string | null = this.getValue(); + const oldAt = oldValue === 'FROM_START' || oldValue === 'FROM_END'; + const newAt = value === 'FROM_START' || value === 'FROM_END'; + if (newAt !== oldAt) { + const block = this.getSourceBlock() as GetSublistBlock; + block.updateAt_(n, newAt); + } + return undefined; + }, + ); + return menu; + }; + this.appendDummyInput('WHERE1_INPUT').appendField(createMenu(1), 'WHERE1'); this.appendDummyInput('AT1'); + this.appendDummyInput('WHERE2_INPUT').appendField(createMenu(2), 'WHERE2'); this.appendDummyInput('AT2'); if (Msg['LISTS_GET_SUBLIST_TAIL']) { this.appendDummyInput('TAIL').appendField(Msg['LISTS_GET_SUBLIST_TAIL']); @@ -896,35 +904,10 @@ const LISTS_GETSUBLIST = { } else { this.appendDummyInput('AT' + n); } - const menu = fieldRegistry.fromJson({ - type: 'field_dropdown', - options: - this[('WHERE_OPTIONS_' + n) as 'WHERE_OPTIONS_1' | 'WHERE_OPTIONS_2'], - }) as FieldDropdown; - menu.setValidator( - /** - * @param value The input value. - * @returns Null if the field has been replaced; otherwise undefined. - */ - function (this: FieldDropdown, value: string) { - const newAt = value === 'FROM_START' || value === 'FROM_END'; - // The 'isAt' variable is available due to this function being a - // closure. - if (newAt !== isAt) { - const block = this.getSourceBlock() as GetSublistBlock; - block.updateAt_(n, newAt); - // This menu has been destroyed and replaced. - // Update the replacement. - block.setFieldValue(value, 'WHERE' + n); - return null; - } - }, - ); - this.getInput('AT' + n)!.appendField(menu, 'WHERE' + n); if (n === 1) { - this.moveInputBefore('AT1', 'AT2'); + this.moveInputBefore('AT1', 'WHERE2_INPUT'); if (this.getInput('ORDINAL1')) { - this.moveInputBefore('ORDINAL1', 'AT2'); + this.moveInputBefore('ORDINAL1', 'WHERE2_INPUT'); } } if (Msg['LISTS_GET_SUBLIST_TAIL']) { diff --git a/blocks/text.ts b/blocks/text.ts index 5ab631836..a7ad5374a 100644 --- a/blocks/text.ts +++ b/blocks/text.ts @@ -216,7 +216,30 @@ const GET_SUBSTRING_BLOCK = { this.appendValueInput('STRING') .setCheck('String') .appendField(Msg['TEXT_GET_SUBSTRING_INPUT_IN_TEXT']); + const createMenu = (n: 1 | 2): FieldDropdown => { + const menu = fieldRegistry.fromJson({ + type: 'field_dropdown', + options: + this[('WHERE_OPTIONS_' + n) as 'WHERE_OPTIONS_1' | 'WHERE_OPTIONS_2'], + }) as FieldDropdown; + menu.setValidator( + /** @param value The input value. */ + function (this: FieldDropdown, value: any): null | undefined { + const oldValue: string | null = this.getValue(); + const oldAt = oldValue === 'FROM_START' || oldValue === 'FROM_END'; + const newAt = value === 'FROM_START' || value === 'FROM_END'; + if (newAt !== oldAt) { + const block = this.getSourceBlock() as GetSubstringBlock; + block.updateAt_(n, newAt); + } + return undefined; + }, + ); + return menu; + }; + this.appendDummyInput('WHERE1_INPUT').appendField(createMenu(1), 'WHERE1'); this.appendDummyInput('AT1'); + this.appendDummyInput('WHERE2_INPUT').appendField(createMenu(2), 'WHERE2'); this.appendDummyInput('AT2'); if (Msg['TEXT_GET_SUBSTRING_TAIL']) { this.appendDummyInput('TAIL').appendField(Msg['TEXT_GET_SUBSTRING_TAIL']); @@ -288,37 +311,10 @@ const GET_SUBSTRING_BLOCK = { this.removeInput('TAIL', true); this.appendDummyInput('TAIL').appendField(Msg['TEXT_GET_SUBSTRING_TAIL']); } - const menu = fieldRegistry.fromJson({ - type: 'field_dropdown', - options: - this[('WHERE_OPTIONS_' + n) as 'WHERE_OPTIONS_1' | 'WHERE_OPTIONS_2'], - }) as FieldDropdown; - menu.setValidator( - /** - * @param value The input value. - * @returns Null if the field has been replaced; otherwise undefined. - */ - function (this: FieldDropdown, value: any): null | undefined { - const newAt = value === 'FROM_START' || value === 'FROM_END'; - // The 'isAt' variable is available due to this function being a - // closure. - if (newAt !== isAt) { - const block = this.getSourceBlock() as GetSubstringBlock; - block.updateAt_(n, newAt); - // This menu has been destroyed and replaced. - // Update the replacement. - block.setFieldValue(value, 'WHERE' + n); - return null; - } - return undefined; - }, - ); - - this.getInput('AT' + n)!.appendField(menu, 'WHERE' + n); if (n === 1) { - this.moveInputBefore('AT1', 'AT2'); + this.moveInputBefore('AT1', 'WHERE2_INPUT'); if (this.getInput('ORDINAL1')) { - this.moveInputBefore('ORDINAL1', 'AT2'); + this.moveInputBefore('ORDINAL1', 'WHERE2_INPUT'); } } }, From bc2b142f62443ce3851c000d990d5a96006b4f5d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 08:29:40 -0700 Subject: [PATCH 54/90] chore(deps): bump @blockly/theme-modern from 6.0.3 to 6.0.7 (#8583) Bumps [@blockly/theme-modern](https://github.com/google/blockly-samples/tree/HEAD/plugins/theme-modern) from 6.0.3 to 6.0.7. - [Release notes](https://github.com/google/blockly-samples/releases) - [Changelog](https://github.com/google/blockly-samples/blob/master/plugins/theme-modern/CHANGELOG.md) - [Commits](https://github.com/google/blockly-samples/commits/@blockly/theme-modern@6.0.7/plugins/theme-modern) --- updated-dependencies: - dependency-name: "@blockly/theme-modern" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7e34a9307..bafb98ef3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -223,11 +223,10 @@ } }, "node_modules/@blockly/theme-modern": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/@blockly/theme-modern/-/theme-modern-6.0.3.tgz", - "integrity": "sha512-pGtwrxqUHfFmT2s8DRZ/FGuBo3hdoVZt66FDFWicripRv5OteXlmLiw3zjbVnca34LHwJ0lKCvUvARAVbPVnHg==", + "version": "6.0.7", + "resolved": "https://registry.npmjs.org/@blockly/theme-modern/-/theme-modern-6.0.7.tgz", + "integrity": "sha512-RUEmunGe1L6So0sTpBd1yUz3foUAzjTj1x0y3P4iyuGu0HzfLIacqUpdU4wQNteGPbKSBp7qDFRXaH/V2eJ6QA==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=8.17.0" }, From 8d44a4d93a62d6580c4f09290f26c192de48a6a4 Mon Sep 17 00:00:00 2001 From: John Nesky Date: Tue, 24 Sep 2024 16:09:41 -0700 Subject: [PATCH 55/90] fix: Group field validator changes with field value changes. (#8589) --- core/field.ts | 105 ++++++++++++++------------ tests/mocha/jso_serialization_test.js | 2 +- 2 files changed, 59 insertions(+), 48 deletions(-) diff --git a/core/field.ts b/core/field.ts index c9d3781a2..c702abadc 100644 --- a/core/field.ts +++ b/core/field.ts @@ -1086,57 +1086,68 @@ export abstract class Field return; } - const classValidation = this.doClassValidation_(newValue); - const classValue = this.processValidation_( - newValue, - classValidation, - fireChangeEvent, - ); - if (classValue instanceof Error) { - if (doLogging) console.log('invalid class validation, return'); - return; + // Field validators are allowed to make changes to the workspace, which + // should get grouped with the field value change event. + const existingGroup = eventUtils.getGroup(); + if (!existingGroup) { + eventUtils.setGroup(true); } - const localValidation = this.getValidator()?.call(this, classValue); - const localValue = this.processValidation_( - classValue, - localValidation, - fireChangeEvent, - ); - if (localValue instanceof Error) { - if (doLogging) console.log('invalid local validation, return'); - return; - } - - const source = this.sourceBlock_; - if (source && source.disposed) { - if (doLogging) console.log('source disposed, return'); - return; - } - - const oldValue = this.getValue(); - if (oldValue === localValue) { - if (doLogging) console.log('same, doValueUpdate_, return'); - this.doValueUpdate_(localValue); - return; - } - - this.doValueUpdate_(localValue); - if (fireChangeEvent && source && eventUtils.isEnabled()) { - eventUtils.fire( - new (eventUtils.get(EventType.BLOCK_CHANGE))( - source, - 'field', - this.name || null, - oldValue, - localValue, - ), + try { + const classValidation = this.doClassValidation_(newValue); + const classValue = this.processValidation_( + newValue, + classValidation, + fireChangeEvent, ); + if (classValue instanceof Error) { + if (doLogging) console.log('invalid class validation, return'); + return; + } + + const localValidation = this.getValidator()?.call(this, classValue); + const localValue = this.processValidation_( + classValue, + localValidation, + fireChangeEvent, + ); + if (localValue instanceof Error) { + if (doLogging) console.log('invalid local validation, return'); + return; + } + + const source = this.sourceBlock_; + if (source && source.disposed) { + if (doLogging) console.log('source disposed, return'); + return; + } + + const oldValue = this.getValue(); + if (oldValue === localValue) { + if (doLogging) console.log('same, doValueUpdate_, return'); + this.doValueUpdate_(localValue); + return; + } + + this.doValueUpdate_(localValue); + if (fireChangeEvent && source && eventUtils.isEnabled()) { + eventUtils.fire( + new (eventUtils.get(EventType.BLOCK_CHANGE))( + source, + 'field', + this.name || null, + oldValue, + localValue, + ), + ); + } + if (this.isDirty_) { + this.forceRerender(); + } + if (doLogging) console.log(this.value_); + } finally { + eventUtils.setGroup(existingGroup); } - if (this.isDirty_) { - this.forceRerender(); - } - if (doLogging) console.log(this.value_); } /** diff --git a/tests/mocha/jso_serialization_test.js b/tests/mocha/jso_serialization_test.js index 7e68edb98..7cf415e67 100644 --- a/tests/mocha/jso_serialization_test.js +++ b/tests/mocha/jso_serialization_test.js @@ -533,7 +533,7 @@ suite('JSO Serialization', function () { }, 'block': { 'type': 'text', - 'id': 'id3', + 'id': 'id4', 'fields': { 'TEXT': '', }, From e5a2e6262282afc3f8c191d0bd863d7853bd952b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Sep 2024 17:29:14 +0100 Subject: [PATCH 56/90] chore(deps): bump @typescript-eslint/eslint-plugin from 8.4.0 to 8.6.0 (#8584) Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 8.4.0 to 8.6.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.6.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 88 +++++++++++++++++++++++------------------------ 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/package-lock.json b/package-lock.json index bafb98ef3..ba35c504a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1240,16 +1240,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.4.0.tgz", - "integrity": "sha512-rg8LGdv7ri3oAlenMACk9e+AR4wUV0yrrG+XKsGKOK0EVgeEDqurkXMPILG2836fW4ibokTB5v4b6Z9+GYQDEw==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.6.0.tgz", + "integrity": "sha512-UOaz/wFowmoh2G6Mr9gw60B1mm0MzUtm6Ic8G2yM1Le6gyj5Loi/N+O5mocugRGY+8OeeKmkMmbxNqUCq3B4Sg==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.4.0", - "@typescript-eslint/type-utils": "8.4.0", - "@typescript-eslint/utils": "8.4.0", - "@typescript-eslint/visitor-keys": "8.4.0", + "@typescript-eslint/scope-manager": "8.6.0", + "@typescript-eslint/type-utils": "8.6.0", + "@typescript-eslint/utils": "8.6.0", + "@typescript-eslint/visitor-keys": "8.6.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -1412,13 +1412,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.4.0.tgz", - "integrity": "sha512-n2jFxLeY0JmKfUqy3P70rs6vdoPjHK8P/w+zJcV3fk0b0BwRXC/zxRTEnAsgYT7MwdQDt/ZEbtdzdVC+hcpF0A==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.6.0.tgz", + "integrity": "sha512-ZuoutoS5y9UOxKvpc/GkvF4cuEmpokda4wRg64JEia27wX+PysIE9q+lzDtlHHgblwUWwo5/Qn+/WyTUvDwBHw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.4.0", - "@typescript-eslint/visitor-keys": "8.4.0" + "@typescript-eslint/types": "8.6.0", + "@typescript-eslint/visitor-keys": "8.6.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1429,9 +1429,9 @@ } }, "node_modules/@typescript-eslint/scope-manager/node_modules/@typescript-eslint/types": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.4.0.tgz", - "integrity": "sha512-T1RB3KQdskh9t3v/qv7niK6P8yvn7ja1mS7QK7XfRVL6wtZ8/mFs/FHf4fKvTA0rKnqnYxl/uHFNbnEt0phgbw==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.6.0.tgz", + "integrity": "sha512-rojqFZGd4MQxw33SrOy09qIDS8WEldM8JWtKQLAjf/X5mGSeEFh5ixQlxssMNyPslVIk9yzWqXCsV2eFhYrYUw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1442,13 +1442,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.4.0.tgz", - "integrity": "sha512-pu2PAmNrl9KX6TtirVOrbLPLwDmASpZhK/XU7WvoKoCUkdtq9zF7qQ7gna0GBZFN0hci0vHaSusiL2WpsQk37A==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.6.0.tgz", + "integrity": "sha512-dtePl4gsuenXVwC7dVNlb4mGDcKjDT/Ropsk4za/ouMBPplCLyznIaR+W65mvCvsyS97dymoBRrioEXI7k0XIg==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "8.4.0", - "@typescript-eslint/utils": "8.4.0", + "@typescript-eslint/typescript-estree": "8.6.0", + "@typescript-eslint/utils": "8.6.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -1480,13 +1480,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.4.0.tgz", - "integrity": "sha512-kJ2OIP4dQw5gdI4uXsaxUZHRwWAGpREJ9Zq6D5L0BweyOrWsL6Sz0YcAZGWhvKnH7fm1J5YFE1JrQL0c9dd53A==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.6.0.tgz", + "integrity": "sha512-MOVAzsKJIPIlLK239l5s06YXjNqpKTVhBVDnqUumQJja5+Y94V3+4VUFRA0G60y2jNnTVwRCkhyGQpavfsbq/g==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.4.0", - "@typescript-eslint/visitor-keys": "8.4.0", + "@typescript-eslint/types": "8.6.0", + "@typescript-eslint/visitor-keys": "8.6.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -1508,9 +1508,9 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/types": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.4.0.tgz", - "integrity": "sha512-T1RB3KQdskh9t3v/qv7niK6P8yvn7ja1mS7QK7XfRVL6wtZ8/mFs/FHf4fKvTA0rKnqnYxl/uHFNbnEt0phgbw==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.6.0.tgz", + "integrity": "sha512-rojqFZGd4MQxw33SrOy09qIDS8WEldM8JWtKQLAjf/X5mGSeEFh5ixQlxssMNyPslVIk9yzWqXCsV2eFhYrYUw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1557,15 +1557,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.4.0.tgz", - "integrity": "sha512-swULW8n1IKLjRAgciCkTCafyTHHfwVQFt8DovmaF69sKbOxTSFMmIZaSHjqO9i/RV0wIblaawhzvtva8Nmm7lQ==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.6.0.tgz", + "integrity": "sha512-eNp9cWnYf36NaOVjkEUznf6fEgVy1TWpE0o52e4wtojjBx7D1UV2WAWGzR+8Y5lVFtpMLPwNbC67T83DWSph4A==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.4.0", - "@typescript-eslint/types": "8.4.0", - "@typescript-eslint/typescript-estree": "8.4.0" + "@typescript-eslint/scope-manager": "8.6.0", + "@typescript-eslint/types": "8.6.0", + "@typescript-eslint/typescript-estree": "8.6.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1579,9 +1579,9 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/types": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.4.0.tgz", - "integrity": "sha512-T1RB3KQdskh9t3v/qv7niK6P8yvn7ja1mS7QK7XfRVL6wtZ8/mFs/FHf4fKvTA0rKnqnYxl/uHFNbnEt0phgbw==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.6.0.tgz", + "integrity": "sha512-rojqFZGd4MQxw33SrOy09qIDS8WEldM8JWtKQLAjf/X5mGSeEFh5ixQlxssMNyPslVIk9yzWqXCsV2eFhYrYUw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1592,12 +1592,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.4.0.tgz", - "integrity": "sha512-zTQD6WLNTre1hj5wp09nBIDiOc2U5r/qmzo7wxPn4ZgAjHql09EofqhF9WF+fZHzL5aCyaIpPcT2hyxl73kr9A==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.6.0.tgz", + "integrity": "sha512-wapVFfZg9H0qOYh4grNVQiMklJGluQrOUiOhYRrQWhx7BY/+I1IYb8BczWNbbUpO+pqy0rDciv3lQH5E1bCLrg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.4.0", + "@typescript-eslint/types": "8.6.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { @@ -1609,9 +1609,9 @@ } }, "node_modules/@typescript-eslint/visitor-keys/node_modules/@typescript-eslint/types": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.4.0.tgz", - "integrity": "sha512-T1RB3KQdskh9t3v/qv7niK6P8yvn7ja1mS7QK7XfRVL6wtZ8/mFs/FHf4fKvTA0rKnqnYxl/uHFNbnEt0phgbw==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.6.0.tgz", + "integrity": "sha512-rojqFZGd4MQxw33SrOy09qIDS8WEldM8JWtKQLAjf/X5mGSeEFh5ixQlxssMNyPslVIk9yzWqXCsV2eFhYrYUw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" From f7a2c4dcd06c1a84a251f7f94b788ddfcced922b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Sep 2024 17:33:25 +0100 Subject: [PATCH 57/90] chore(deps): bump webdriverio from 9.0.7 to 9.0.9 (#8582) Bumps [webdriverio](https://github.com/webdriverio/webdriverio/tree/HEAD/packages/webdriverio) from 9.0.7 to 9.0.9. - [Release notes](https://github.com/webdriverio/webdriverio/releases) - [Changelog](https://github.com/webdriverio/webdriverio/blob/main/CHANGELOG.md) - [Commits](https://github.com/webdriverio/webdriverio/commits/v9.0.9/packages/webdriverio) --- updated-dependencies: - dependency-name: webdriverio dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 167 +++++++++++++++++++++++----------------------- 1 file changed, 84 insertions(+), 83 deletions(-) diff --git a/package-lock.json b/package-lock.json index ba35c504a..c838c1c2e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -937,9 +937,9 @@ } }, "node_modules/@promptbook/utils": { - "version": "0.68.0", - "resolved": "https://registry.npmjs.org/@promptbook/utils/-/utils-0.68.0.tgz", - "integrity": "sha512-EaV8YtUrbFLAjwOx9JcJqnfSiF+dm4kLrB2umzVJn/yEFMIOoC0GTWz1mX328HSA5cBvqC7+SBeWubplL9THcg==", + "version": "0.70.0-1", + "resolved": "https://registry.npmjs.org/@promptbook/utils/-/utils-0.70.0-1.tgz", + "integrity": "sha512-qd2lLRRN+sE6UuNMi2tEeUUeb4zmXnxY5EMdfHVXNE+bqBDpUC7/aEfXgA3jnUXEr+xFjQ8PTFQgWvBMaKvw0g==", "dev": true, "funding": [ { @@ -956,9 +956,9 @@ } }, "node_modules/@puppeteer/browsers": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.3.1.tgz", - "integrity": "sha512-uK7o3hHkK+naEobMSJ+2ySYyXtQkBxIH8Gn4MK9ciePjNV+Pf+PgY/W7iPzn2MTjl3stcYB5AlcTmPYw7AXDwA==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.4.0.tgz", + "integrity": "sha512-x8J1csfIygOwf6D6qUAZ0ASk3z63zPb7wkNeHRerCMh82qWKUrOgkuP005AJC8lDL6/evtXETGEJVcwykKT4/g==", "dev": true, "dependencies": { "debug": "^4.3.6", @@ -1628,27 +1628,27 @@ "dev": true }, "node_modules/@wdio/config": { - "version": "9.0.6", - "resolved": "https://registry.npmjs.org/@wdio/config/-/config-9.0.6.tgz", - "integrity": "sha512-WsACM5QjT3ZsoPVqHroYt8pOkZx4/6PTdNKm45VL8NHhQe5w9IFbl1fKxFHQ7ZkPI3F+EFvFvubO8puJ0OcSmQ==", + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/@wdio/config/-/config-9.0.8.tgz", + "integrity": "sha512-37L+hd+A1Nyehd/pgfTrLC6w+Ngbu0CIoFh9Vv6v8Cgu5Hih0TLofvlg+J1BNbcTd5eQ2tFKZBDeFMhQaIiTpg==", "dev": true, "dependencies": { - "@wdio/logger": "9.0.4", - "@wdio/types": "9.0.4", - "@wdio/utils": "9.0.6", + "@wdio/logger": "9.0.8", + "@wdio/types": "9.0.8", + "@wdio/utils": "9.0.8", "decamelize": "^6.0.0", "deepmerge-ts": "^7.0.3", "glob": "^10.2.2", "import-meta-resolve": "^4.0.0" }, "engines": { - "node": ">=18" + "node": ">=18.20.0" } }, "node_modules/@wdio/logger": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/@wdio/logger/-/logger-9.0.4.tgz", - "integrity": "sha512-b6gcu0PTVb3fgK4kyAH/k5UUWN5FOUdAfhA4PAY/IZvxZTMFYMqnrZb0WRWWWqL6nu9pcrOVtCOdPBvj0cb+Nw==", + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/@wdio/logger/-/logger-9.0.8.tgz", + "integrity": "sha512-uIyYIDBwLczmsp9JE5hN3ME8Xg+9WNBfSNXD69ICHrY9WPTzFf94UeTuavK7kwSKF3ro2eJbmNZItYOfnoovnw==", "dev": true, "dependencies": { "chalk": "^5.1.2", @@ -1657,7 +1657,7 @@ "strip-ansi": "^7.1.0" }, "engines": { - "node": ">=18" + "node": ">=18.20.0" } }, "node_modules/@wdio/logger/node_modules/chalk": { @@ -1688,44 +1688,44 @@ } }, "node_modules/@wdio/protocols": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/@wdio/protocols/-/protocols-9.0.4.tgz", - "integrity": "sha512-T9v8Jkp94NxLLil5J7uJ/+YHk5/7fhOggzGcN+LvuCHS6jbJFZ/11c4SUEuXw27Yqk01fFXPBbF6TwcTTOuW/Q==", + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/@wdio/protocols/-/protocols-9.0.8.tgz", + "integrity": "sha512-xRH54byFf623/w/KW62xkf/C2mGyigSfMm+UT3tNEAd5ZA9X2VAWQWQBPzdcrsck7Fxk4zlQX8Kb34RSs7Cy4Q==", "dev": true }, "node_modules/@wdio/repl": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/@wdio/repl/-/repl-9.0.4.tgz", - "integrity": "sha512-5Bc5ARjWA7t6MZNnVJ9WvO1iDsy6iOsrSDWiP7APWAdaF/SJCP3SFE2c+PdQJpJWhr2Kk0fRGuyDM+GdsmZhwg==", + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/@wdio/repl/-/repl-9.0.8.tgz", + "integrity": "sha512-3iubjl4JX5zD21aFxZwQghqC3lgu+mSs8c3NaiYYNCC+IT5cI/8QuKlgh9s59bu+N3gG988jqMJeCYlKuUv/iw==", "dev": true, "dependencies": { "@types/node": "^20.1.0" }, "engines": { - "node": ">=18" + "node": ">=18.20.0" } }, "node_modules/@wdio/types": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/@wdio/types/-/types-9.0.4.tgz", - "integrity": "sha512-MN7O4Uk3zPWvkN8d6SNdIjd7qHUlTxS7j0QfRPu6TdlYbHu6BJJ8Rr84y7GcUzCnTAJ1nOIpvUyR8MY3hOaVKg==", + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/@wdio/types/-/types-9.0.8.tgz", + "integrity": "sha512-pmz2iRWddTanrv8JC7v3wUGm17KRv2WyyJhQfklMSANn9V1ep6pw1RJG2WJnKq4NojMvH1nVv1sMZxXrYPhpYw==", "dev": true, "dependencies": { "@types/node": "^20.1.0" }, "engines": { - "node": ">=18" + "node": ">=18.20.0" } }, "node_modules/@wdio/utils": { - "version": "9.0.6", - "resolved": "https://registry.npmjs.org/@wdio/utils/-/utils-9.0.6.tgz", - "integrity": "sha512-cnPXeW/sfqyKFuRRmADRZDNvFwEBMr7j7wwWLO6q5opoW++dwOdJW4WV0wDZbPcXTtGFCSrGCDLLdGcTAWMb3A==", + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/@wdio/utils/-/utils-9.0.8.tgz", + "integrity": "sha512-p3EgOdkhCvMxJFd3WTtSChqYFQu2mz69/5tOsljDaL+4QYwnRR7O8M9wFsL3/9XMVcHdnC4Ija2VRxQ/lb+hHQ==", "dev": true, "dependencies": { "@puppeteer/browsers": "^2.2.0", - "@wdio/logger": "9.0.4", - "@wdio/types": "9.0.4", + "@wdio/logger": "9.0.8", + "@wdio/types": "9.0.8", "decamelize": "^6.0.0", "deepmerge-ts": "^7.0.3", "edgedriver": "^5.6.1", @@ -1738,7 +1738,7 @@ "wait-port": "^1.1.0" }, "engines": { - "node": ">=18" + "node": ">=18.20.0" } }, "node_modules/@yarnpkg/lockfile": { @@ -2285,9 +2285,9 @@ } }, "node_modules/b4a": { - "version": "1.6.4", - "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.4.tgz", - "integrity": "sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==", + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.6.tgz", + "integrity": "sha512-5Tk1HLk6b6ctmjIkAcU/Ujv/1WqiDl0F0JdRCR80VsOcUlHcu7pWeWRlOqQLHfDEsVx9YH/aif5AG4ehoCtTmg==", "dev": true }, "node_modules/bach": { @@ -2318,9 +2318,9 @@ "optional": true }, "node_modules/bare-fs": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-2.3.3.tgz", - "integrity": "sha512-7RYKL+vZVCyAsMLi5SPu7QGauGGT8avnP/HO571ndEuV4MYdGXvLhtW67FuLPeEI8EiIY7zbbRR9x7x7HU0kgw==", + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-2.3.5.tgz", + "integrity": "sha512-SlE9eTxifPDJrT6YgemQ1WGFleevzwY+XAP1Xqgl56HtcrisC2CHCZ2tq6dBpcH2TnNxwUEUGhweo+lrQtYuiw==", "dev": true, "optional": true, "dependencies": { @@ -2330,9 +2330,9 @@ } }, "node_modules/bare-os": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-2.4.2.tgz", - "integrity": "sha512-HZoJwzC+rZ9lqEemTMiO0luOePoGYNBgsLLgegKR/cljiJvcDNhDZQkzC+NC5Oh0aHbdBNSOHpghwMuB5tqhjg==", + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-2.4.4.tgz", + "integrity": "sha512-z3UiI2yi1mK0sXeRdc4O1Kk8aOa/e+FNWZcTiPB/dfTWyLypuE99LibgRaQki914Jq//yAWylcAt+mknKdixRQ==", "dev": true, "optional": true }, @@ -2347,13 +2347,14 @@ } }, "node_modules/bare-stream": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.2.0.tgz", - "integrity": "sha512-+o9MG5bPRRBlkVSpfFlMag3n7wMaIZb4YZasU2+/96f+3HTQ4F9DKQeu3K/Sjz1W0umu6xvVq1ON0ipWdMlr3A==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.3.0.tgz", + "integrity": "sha512-pVRWciewGUeCyKEuRxwv06M079r+fRjAQjBEK2P6OYGrO43O+Z0LrPZZEjlc4mB6C2RpZ9AxJ1s7NLEtOHO6eA==", "dev": true, "optional": true, "dependencies": { - "streamx": "^2.18.0" + "b4a": "^1.6.6", + "streamx": "^2.20.0" } }, "node_modules/base64-js": { @@ -4135,9 +4136,9 @@ "dev": true }, "node_modules/fast-xml-parser": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz", - "integrity": "sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.0.tgz", + "integrity": "sha512-/PlTQCI96+fZMAOLMZK4CWG1ItCbfZ/0jx7UIJFChPNrx7tcEgerUgWbeieCM9MfHInUDyK8DWYZ+YrywDJuTg==", "dev": true, "funding": [ { @@ -6234,9 +6235,9 @@ } }, "node_modules/locate-app": { - "version": "2.4.35", - "resolved": "https://registry.npmjs.org/locate-app/-/locate-app-2.4.35.tgz", - "integrity": "sha512-LmAKEZ5UR4yja7YTYyapV1eNG3Yc/W9N28xTX5tzOJ68NyWs4Laf6wmH3l8wST7T4kaaYaDqdW1UQ+5nOFVBpw==", + "version": "2.4.43", + "resolved": "https://registry.npmjs.org/locate-app/-/locate-app-2.4.43.tgz", + "integrity": "sha512-BX6NEdECUGcDQw8aqqg02qLyF9rF8V+dAfyAnBzL2AofIlIvf4Q6EGXnzVWpWot9uBE+x/o8CjXHo7Zlegu91Q==", "dev": true, "funding": [ { @@ -6249,7 +6250,7 @@ } ], "dependencies": { - "@promptbook/utils": "0.68.0", + "@promptbook/utils": "0.70.0-1", "type-fest": "2.13.0", "userhome": "1.0.0" } @@ -6347,9 +6348,9 @@ } }, "node_modules/loglevel": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.9.1.tgz", - "integrity": "sha512-hP3I3kCrDIMuRwAwHltphhDM1r8i55H33GgqjXbrisuJhF4kRhW1dNuxsRklp4bXl8DSdLaNLuiL4A/LWRfxvg==", + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.9.2.tgz", + "integrity": "sha512-HgMmCqIJSAKqo68l0rS2AanEWfkxaZ5wNiEFb5ggm08lDs9Xl2KxBlX3PTcaD2chBM1gXAYf491/M2Rv8Jwayg==", "dev": true, "engines": { "node": ">= 0.6.0" @@ -7452,9 +7453,9 @@ "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==" }, "node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz", + "integrity": "sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==", "dev": true, "dependencies": { "end-of-stream": "^1.1.0", @@ -8166,9 +8167,9 @@ "dev": true }, "node_modules/streamx": { - "version": "2.18.0", - "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.18.0.tgz", - "integrity": "sha512-LLUC1TWdjVdn1weXGcSxyTR3T4+acB6tVGXT95y0nGbca4t4o/ng1wKAGTljm9VicuCVLvRlqFYXYy5GwgM7sQ==", + "version": "2.20.1", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.20.1.tgz", + "integrity": "sha512-uTa0mU6WUC65iUvzKH4X9hEdvSW7rbPxPtwfWiLMSj3qTdQbAiUboZTxauKfpFuGIGa1C2BYijZ7wgdUXICJhA==", "dev": true, "dependencies": { "fast-fifo": "^1.3.2", @@ -8937,39 +8938,39 @@ } }, "node_modules/webdriver": { - "version": "9.0.7", - "resolved": "https://registry.npmjs.org/webdriver/-/webdriver-9.0.7.tgz", - "integrity": "sha512-0PN4omqCGlgi3RG0LyrQXr0RUmlDCenNtpN+dfzikfYoV+CHiCw2GMnZp2XCuYUnU01MaCKgRQxLuGobyZov+A==", + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/webdriver/-/webdriver-9.0.8.tgz", + "integrity": "sha512-UnV0ANriSTUgypGk0pz8lApeQuHt+72WEDQG5hFwkkSvggtKLyWdT7+PQkNoXvDajTmiLIqUOq8XPI/Pm71rtw==", "dev": true, "dependencies": { "@types/node": "^20.1.0", "@types/ws": "^8.5.3", - "@wdio/config": "9.0.6", - "@wdio/logger": "9.0.4", - "@wdio/protocols": "9.0.4", - "@wdio/types": "9.0.4", - "@wdio/utils": "9.0.6", + "@wdio/config": "9.0.8", + "@wdio/logger": "9.0.8", + "@wdio/protocols": "9.0.8", + "@wdio/types": "9.0.8", + "@wdio/utils": "9.0.8", "deepmerge-ts": "^7.0.3", "ws": "^8.8.0" }, "engines": { - "node": ">=18" + "node": ">=18.20.0" } }, "node_modules/webdriverio": { - "version": "9.0.7", - "resolved": "https://registry.npmjs.org/webdriverio/-/webdriverio-9.0.7.tgz", - "integrity": "sha512-/6CvJkKpUWYbX/59PNJCHXGLPwulQ/bXZwlIUrsF6MWKdf8Eb6yTaXkMJBaBy5x496b50PQcXkbe+qpfsnqXsg==", + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/webdriverio/-/webdriverio-9.0.9.tgz", + "integrity": "sha512-IwvKzhcJ9NjOL55xwj27uTTKkfxsg77dmAfqoKFSP5dQ70JzU+NgxiALEjjWQDybtt1yGIkHk7wjjxjboMU1uw==", "dev": true, "dependencies": { "@types/node": "^20.11.30", "@types/sinonjs__fake-timers": "^8.1.5", - "@wdio/config": "9.0.6", - "@wdio/logger": "9.0.4", - "@wdio/protocols": "9.0.4", - "@wdio/repl": "9.0.4", - "@wdio/types": "9.0.4", - "@wdio/utils": "9.0.6", + "@wdio/config": "9.0.8", + "@wdio/logger": "9.0.8", + "@wdio/protocols": "9.0.8", + "@wdio/repl": "9.0.8", + "@wdio/types": "9.0.8", + "@wdio/utils": "9.0.8", "archiver": "^7.0.1", "aria-query": "^5.3.0", "cheerio": "^1.0.0-rc.12", @@ -8988,10 +8989,10 @@ "rgb2hex": "0.2.5", "serialize-error": "^11.0.3", "urlpattern-polyfill": "^10.0.0", - "webdriver": "9.0.7" + "webdriver": "9.0.8" }, "engines": { - "node": ">=18" + "node": ">=18.20.0" }, "peerDependencies": { "puppeteer-core": "^22.3.0" From 5fd337bb4d12b68766cae8094893ed0131285666 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2024 10:56:31 -0700 Subject: [PATCH 58/90] chore(deps): bump concurrently from 8.2.2 to 9.0.1 (#8602) Bumps [concurrently](https://github.com/open-cli-tools/concurrently) from 8.2.2 to 9.0.1. - [Release notes](https://github.com/open-cli-tools/concurrently/releases) - [Commits](https://github.com/open-cli-tools/concurrently/compare/v8.2.2...v9.0.1) --- updated-dependencies: - dependency-name: concurrently dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 52 +++++------------------------------------------ package.json | 2 +- 2 files changed, 6 insertions(+), 48 deletions(-) diff --git a/package-lock.json b/package-lock.json index c838c1c2e..1b9f4b504 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,7 @@ "@typescript-eslint/parser": "^8.1.0", "async-done": "^2.0.0", "chai": "^5.1.1", - "concurrently": "^8.0.1", + "concurrently": "^9.0.1", "eslint": "^8.4.1", "eslint-config-google": "^0.14.0", "eslint-config-prettier": "^9.0.0", @@ -68,18 +68,6 @@ "node": ">=0.10.0" } }, - "node_modules/@babel/runtime": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.5.tgz", - "integrity": "sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA==", - "dev": true, - "dependencies": { - "regenerator-runtime": "^0.13.11" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@blockly/block-test": { "version": "6.0.8", "resolved": "https://registry.npmjs.org/@blockly/block-test/-/block-test-6.0.8.tgz", @@ -2927,17 +2915,15 @@ } }, "node_modules/concurrently": { - "version": "8.2.2", - "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-8.2.2.tgz", - "integrity": "sha512-1dP4gpXFhei8IOtlXRE/T/4H88ElHgTiUzh71YUmtjTEHMSRS2Z/fgOxHSxxusGHogsRfxNq1vyAwxSC+EVyDg==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-9.0.1.tgz", + "integrity": "sha512-wYKvCd/f54sTXJMSfV6Ln/B8UrfLBKOYa+lzc6CHay3Qek+LorVSBdMVfyewFhRbH0Rbabsk4D+3PL/VjQ5gzg==", "dev": true, "dependencies": { "chalk": "^4.1.2", - "date-fns": "^2.30.0", "lodash": "^4.17.21", "rxjs": "^7.8.1", "shell-quote": "^1.8.1", - "spawn-command": "0.0.2", "supports-color": "^8.1.1", "tree-kill": "^1.2.2", "yargs": "^17.7.2" @@ -2947,7 +2933,7 @@ "concurrently": "dist/bin/concurrently.js" }, "engines": { - "node": "^14.13.0 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/open-cli-tools/concurrently?sponsor=1" @@ -3242,22 +3228,6 @@ "node": ">=18" } }, - "node_modules/date-fns": { - "version": "2.30.0", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", - "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.21.0" - }, - "engines": { - "node": ">=0.11" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/date-fns" - } - }, "node_modules/debug": { "version": "4.3.6", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", @@ -7602,12 +7572,6 @@ "node": ">= 10.13.0" } }, - "node_modules/regenerator-runtime": { - "version": "0.13.11", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", - "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", - "dev": true - }, "node_modules/remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", @@ -8073,12 +8037,6 @@ "node": ">= 10.13.0" } }, - "node_modules/spawn-command": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2.tgz", - "integrity": "sha512-zC8zGoGkmc8J9ndvml8Xksr1Amk9qBujgbF0JAIWO7kXr43w0h/0GJNM/Vustixu+YE8N/MTrQ7N31FvHUACxQ==", - "dev": true - }, "node_modules/spdx-exceptions": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", diff --git a/package.json b/package.json index 2ec843f3d..484295182 100644 --- a/package.json +++ b/package.json @@ -111,7 +111,7 @@ "@typescript-eslint/parser": "^8.1.0", "async-done": "^2.0.0", "chai": "^5.1.1", - "concurrently": "^8.0.1", + "concurrently": "^9.0.1", "eslint": "^8.4.1", "eslint-config-google": "^0.14.0", "eslint-config-prettier": "^9.0.0", From 9b3603a3ea68ebf0b3632bc160170aeef7e59849 Mon Sep 17 00:00:00 2001 From: John Nesky Date: Tue, 1 Oct 2024 17:00:59 -0700 Subject: [PATCH 59/90] fix: Let block factory overwrite user defined blocks. (#8605) --- .../blockfactory/block_library_controller.js | 4 +-- demos/blockfactory/block_library_view.js | 26 +++++++++---------- demos/blockfactory/blocks.js | 4 +++ demos/blockfactory/factory.js | 5 ++-- 4 files changed, 22 insertions(+), 17 deletions(-) diff --git a/demos/blockfactory/block_library_controller.js b/demos/blockfactory/block_library_controller.js index 7bb34e8d6..8eed54db0 100644 --- a/demos/blockfactory/block_library_controller.js +++ b/demos/blockfactory/block_library_controller.js @@ -109,9 +109,9 @@ BlockLibraryController.prototype.clearBlockLibrary = function() { BlockLibraryController.prototype.saveToBlockLibrary = function() { var blockType = this.getCurrentBlockType(); // If user has not changed the name of the starter block. - if (blockType === 'block_type') { + if (reservedBlockFactoryBlocks.has(blockType) || blockType === 'block_type') { // Do not save block if it has the default type, 'block_type'. - var msg = 'You cannot save a block under the name "block_type". Try ' + + var msg = `You cannot save a block under the name "${blockType}". Try ` + 'changing the name before saving. Then, click on the "Block Library"' + ' button to view your saved blocks.'; alert(msg); diff --git a/demos/blockfactory/block_library_view.js b/demos/blockfactory/block_library_view.js index a47980408..2c91ce378 100644 --- a/demos/blockfactory/block_library_view.js +++ b/demos/blockfactory/block_library_view.js @@ -104,36 +104,36 @@ BlockLibraryView.prototype.updateButtons = // User is editing a block. if (!isInLibrary) { - // Block type has not been saved to library yet. Disable the delete button - // and allow user to save. + // Block type has not been saved to the library yet. + // Disable the delete button. this.saveButton.textContent = 'Save "' + blockType + '"'; - this.saveButton.disabled = false; this.deleteButton.disabled = true; } else { - // Block type has already been saved. Disable the save button unless the - // there are unsaved changes (checked below). + // A version of the block type has already been saved. + // Enable the delete button. this.saveButton.textContent = 'Update "' + blockType + '"'; - this.saveButton.disabled = true; this.deleteButton.disabled = false; } this.deleteButton.textContent = 'Delete "' + blockType + '"'; - // If changes to block have been made and are not saved, make button - // green to encourage user to save the block. + this.saveButton.classList.remove('button_alert', 'button_warn'); if (!savedChanges) { - var buttonFormatClass = 'button_warn'; + var buttonFormatClass; - // If block type is the default, 'block_type', make button red to alert - // user. - if (blockType === 'block_type') { + var isReserved = reservedBlockFactoryBlocks.has(blockType); + if (isReserved || blockType === 'block_type') { + // Make button red to alert user that the block type can't be saved. buttonFormatClass = 'button_alert'; + } else { + // Block type has not been saved to library yet or has unsaved changes. + // Make the button green to encourage the user to save the block. + buttonFormatClass = 'button_warn'; } this.saveButton.classList.add(buttonFormatClass); this.saveButton.disabled = false; } else { // No changes to save. - this.saveButton.classList.remove('button_alert', 'button_warn'); this.saveButton.disabled = true; } diff --git a/demos/blockfactory/blocks.js b/demos/blockfactory/blocks.js index 34313cad1..9a983460f 100644 --- a/demos/blockfactory/blocks.js +++ b/demos/blockfactory/blocks.js @@ -914,3 +914,7 @@ function inputNameCheck(referenceBlock) { 'There are ' + count + ' input blocks\n with this name.' : null; referenceBlock.setWarningText(msg); } + +// Make a set of all of block types that are required for the block factory. +var reservedBlockFactoryBlocks = + new Set(Object.getOwnPropertyNames(Blockly.Blocks)); diff --git a/demos/blockfactory/factory.js b/demos/blockfactory/factory.js index 07ee889de..2e6ebc924 100644 --- a/demos/blockfactory/factory.js +++ b/demos/blockfactory/factory.js @@ -187,8 +187,9 @@ BlockFactory.updatePreview = function() { // Don't let the user create a block type that already exists, // because it doesn't work. var warnExistingBlock = function(blockType) { - if (blockType in Blockly.Blocks) { - var text = `You can't make a block called ${blockType} in this tool because that name already exists.`; + if (reservedBlockFactoryBlocks.has(blockType)) { + var text = `You can't make a block called ${blockType} in this tool ` + + `because that name is reserved.`; FactoryUtils.getRootBlock(BlockFactory.mainWorkspace).setWarningText(text); console.error(text); return true; From 9cd58e325a90a6ab22f93dbdd14a7a7162366944 Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Wed, 2 Oct 2024 12:30:19 +0100 Subject: [PATCH 60/90] refactor(shortcuts): Improve shortcut registry documentation & style (#8598) * refactor(shortcuts): Improve shortcut registry documentation & style Make some minor refactorings of shortcut_registry.ts to improve readability and style, and add documentation for the KeyboardShortcut interface type. * docs(shortcuts): Fix JSDoc typos etc. for PR #8598 * chore: Format --- core/shortcut_registry.ts | 131 ++++++++++++++++++++++++++++---------- 1 file changed, 98 insertions(+), 33 deletions(-) diff --git a/core/shortcut_registry.ts b/core/shortcut_registry.ts index 161a2ed14..32615c866 100644 --- a/core/shortcut_registry.ts +++ b/core/shortcut_registry.ts @@ -45,31 +45,27 @@ export class ShortcutRegistry { * Registers a keyboard shortcut. * * @param shortcut The shortcut for this key code. - * @param opt_allowOverrides True to prevent a warning when overriding an + * @param allowOverrides True to prevent a warning when overriding an * already registered item. * @throws {Error} if a shortcut with the same name already exists. */ - register(shortcut: KeyboardShortcut, opt_allowOverrides?: boolean) { + register(shortcut: KeyboardShortcut, allowOverrides?: boolean) { const registeredShortcut = this.shortcuts.get(shortcut.name); - if (registeredShortcut && !opt_allowOverrides) { + if (registeredShortcut && !allowOverrides) { throw new Error(`Shortcut named "${shortcut.name}" already exists.`); } this.shortcuts.set(shortcut.name, shortcut); const keyCodes = shortcut.keyCodes; - if (keyCodes && keyCodes.length > 0) { - for (let i = 0; i < keyCodes.length; i++) { - this.addKeyMapping( - keyCodes[i], - shortcut.name, - !!shortcut.allowCollision, - ); + if (keyCodes?.length) { + for (const keyCode of keyCodes) { + this.addKeyMapping(keyCode, shortcut.name, !!shortcut.allowCollision); } } } /** - * Unregisters a keyboard shortcut registered with the given key code. This + * Unregisters a keyboard shortcut registered with the given name. This * will also remove any key mappings that reference this shortcut. * * @param shortcutName The name of the shortcut to unregister. @@ -92,27 +88,34 @@ export class ShortcutRegistry { /** * Adds a mapping between a keycode and a keyboard shortcut. * + * Normally only one shortcut can be mapped to any given keycode, + * but setting allowCollisions to true allows a keyboard to be + * mapped to multiple shortcuts. In that case, when onKeyDown is + * called with the given keystroke, it will process the mapped + * shortcuts in reverse order, from the most- to least-recently + * mapped). + * * @param keyCode The key code for the keyboard shortcut. If registering a key * code with a modifier (ex: ctrl+c) use * ShortcutRegistry.registry.createSerializedKey; * @param shortcutName The name of the shortcut to execute when the given * keycode is pressed. - * @param opt_allowCollision True to prevent an error when adding a shortcut + * @param allowCollision True to prevent an error when adding a shortcut * to a key that is already mapped to a shortcut. * @throws {Error} if the given key code is already mapped to a shortcut. */ addKeyMapping( keyCode: string | number | KeyCodes, shortcutName: string, - opt_allowCollision?: boolean, + allowCollision?: boolean, ) { keyCode = `${keyCode}`; const shortcutNames = this.keyMap.get(keyCode); - if (shortcutNames && !opt_allowCollision) { + if (shortcutNames && !allowCollision) { throw new Error( `Shortcut named "${shortcutName}" collides with shortcuts "${shortcutNames}"`, ); - } else if (shortcutNames && opt_allowCollision) { + } else if (shortcutNames && allowCollision) { shortcutNames.unshift(shortcutName); } else { this.keyMap.set(keyCode, [shortcutName]); @@ -127,19 +130,19 @@ export class ShortcutRegistry { * ShortcutRegistry.registry.createSerializedKey; * @param shortcutName The name of the shortcut to execute when the given * keycode is pressed. - * @param opt_quiet True to not console warn when there is no shortcut to + * @param quiet True to not console warn when there is no shortcut to * remove. * @returns True if a key mapping was removed, false otherwise. */ removeKeyMapping( keyCode: string, shortcutName: string, - opt_quiet?: boolean, + quiet?: boolean, ): boolean { const shortcutNames = this.keyMap.get(keyCode); if (!shortcutNames) { - if (!opt_quiet) { + if (!quiet) { console.warn( `No keyboard shortcut named "${shortcutName}" registered with key code "${keyCode}"`, ); @@ -155,7 +158,7 @@ export class ShortcutRegistry { } return true; } - if (!opt_quiet) { + if (!quiet) { console.warn( `No keyboard shortcut named "${shortcutName}" registered with key code "${keyCode}"`, ); @@ -172,7 +175,7 @@ export class ShortcutRegistry { */ removeAllKeyMappings(shortcutName: string) { for (const keyCode of this.keyMap.keys()) { - this.removeKeyMapping(keyCode, shortcutName, true); + this.removeKeyMapping(keyCode, shortcutName, /* quiet= */ true); } } @@ -219,6 +222,21 @@ export class ShortcutRegistry { /** * Handles key down events. * + * - Any `KeyboardShortcut`(s) mapped to the keycodes that cause + * event `e` to be fired will be processed, in order from least- + * to most-recently registered. + * - If the shortcut's `preconditionFn` exists it will be called. + * If `preconditionFn` returns false the shortcut's `callback` + * function will be skipped. Processing will continue with the + * next shortcut, if any. + * - The shortcut's `callback` function will then be called. If it + * returns true, processing will terminate and `onKeyDown` will + * return true. If it returns false, processing will continue + * with with the next shortcut, if any. + * - If all registered shortcuts for the given keycode have been + * processed without any having returned true, `onKeyDown` will + * return false. + * * @param workspace The main workspace where the event was captured. * @param e The key down event. * @returns True if the event was handled, false otherwise. @@ -226,17 +244,17 @@ export class ShortcutRegistry { onKeyDown(workspace: WorkspaceSvg, e: KeyboardEvent): boolean { const key = this.serializeKeyEvent_(e); const shortcutNames = this.getShortcutNamesByKeyCode(key); - if (!shortcutNames) { - return false; - } - for (let i = 0, shortcutName; (shortcutName = shortcutNames[i]); i++) { + if (!shortcutNames) return false; + for (const shortcutName of shortcutNames) { const shortcut = this.shortcuts.get(shortcutName); - if (!shortcut?.preconditionFn || shortcut?.preconditionFn(workspace)) { - // If the key has been handled, stop processing shortcuts. - if (shortcut?.callback && shortcut?.callback(workspace, e, shortcut)) { - return true; - } + if ( + !shortcut || + (shortcut.preconditionFn && !shortcut.preconditionFn(workspace)) + ) { + continue; } + // If the key has been handled, stop processing shortcuts. + if (shortcut.callback?.(workspace, e, shortcut)) return true; } return false; } @@ -301,7 +319,7 @@ export class ShortcutRegistry { * @throws {Error} if the modifier is not in the valid modifiers list. */ private checkModifiers_(modifiers: KeyCodes[]) { - for (let i = 0, modifier; (modifier = modifiers[i]); i++) { + for (const modifier of modifiers) { if (!(modifier in ShortcutRegistry.modifierKeys)) { throw new Error(modifier + ' is not a valid modifier key.'); } @@ -313,7 +331,7 @@ export class ShortcutRegistry { * * @param keyCode Number code representing the key. * @param modifiers List of modifier key codes to be used with the key. All - * valid modifiers can be found in the ShortcutRegistry.modifierKeys. + * valid modifiers can be found in the `ShortcutRegistry.modifierKeys`. * @returns The serialized key code for the given modifiers and key. */ createSerializedKey(keyCode: number, modifiers: KeyCodes[] | null): string { @@ -344,12 +362,59 @@ export class ShortcutRegistry { } export namespace ShortcutRegistry { + /** Interface defining a keyboard shortcut. */ export interface KeyboardShortcut { - callback?: (p1: WorkspaceSvg, p2: Event, p3: KeyboardShortcut) => boolean; + /** + * The function to be called when the shorctut is invoked. + * + * @param workspace The `WorkspaceSvg` when the shortcut was + * invoked. + * @param e The event that caused the shortcut to be activated. + * @param shortcut The `KeyboardShortcut` that was activated + * (i.e., the one this callback is attached to). + * @returns Returning true ends processing of the invoked keycode. + * Returning false causes processing to continue with the + * next-most-recently registered shortcut for the invoked + * keycode. + */ + callback?: ( + workspace: WorkspaceSvg, + e: Event, + shortcut: KeyboardShortcut, + ) => boolean; + + /** The name of the shortcut. Should be unique. */ name: string; - preconditionFn?: (p1: WorkspaceSvg) => boolean; + + /** + * A function to be called when the shortcut is invoked, before + * calling `callback`, to decide if this shortcut is applicable in + * the current situation. + * + * @param workspace The `WorkspaceSvg` where the shortcut was + * invoked. + * @returns True iff `callback` function should be called. + */ + preconditionFn?: (workspace: WorkspaceSvg) => boolean; + + /** Optional arbitray extra data attached to the shortcut. */ metadata?: object; + + /** + * Optional list of key codes to be bound (via + * ShortcutRegistry.prototype.addKeyMapping) to this shortcut. + */ keyCodes?: (number | string)[]; + + /** + * Value of `allowCollision` to pass to `addKeyMapping` when + * binding this shortcut's `.keyCodes` (if any). + * + * N.B.: this is only used for binding keycodes at the time this + * shortcut is initially registered, not for any subsequent + * `addKeyMapping` calls that happen to reference this shortcut's + * name. + */ allowCollision?: boolean; } From c8c4684d3beeec305fc52f3c4a7a3882455f537c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Oct 2024 12:56:32 +0100 Subject: [PATCH 61/90] chore(deps): bump @hyperjump/json-schema from 1.9.6 to 1.9.8 (#8603) Bumps [@hyperjump/json-schema](https://github.com/hyperjump-io/json-schema) from 1.9.6 to 1.9.8. - [Commits](https://github.com/hyperjump-io/json-schema/compare/v1.9.6...v1.9.8) --- updated-dependencies: - dependency-name: "@hyperjump/json-schema" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1b9f4b504..0368f230c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -488,9 +488,9 @@ } }, "node_modules/@hyperjump/json-schema": { - "version": "1.9.6", - "resolved": "https://registry.npmjs.org/@hyperjump/json-schema/-/json-schema-1.9.6.tgz", - "integrity": "sha512-tv0JLDESJCGEPR1LNDNHEdr/AV+kjmfwpsayNPnk8Qy55VPZvXpr5SpExlq8HwB9IXJp1ScfIcrcVrpaWN2Yxw==", + "version": "1.9.8", + "resolved": "https://registry.npmjs.org/@hyperjump/json-schema/-/json-schema-1.9.8.tgz", + "integrity": "sha512-qmdMpYn8CpYR7z3fxkL6fgkDvMaAEFKtmYu3XDi6hWW2BT+rLl7T4Y4QpafEIR4wkcmCxcJf9me9FmxKpv3i9g==", "dev": true, "dependencies": { "@hyperjump/json-pointer": "^1.1.0", From 51c5809ed98d6af7d5673c9c4ab40148b2d78dbe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 08:25:39 -0700 Subject: [PATCH 62/90] chore(deps): bump @typescript-eslint/parser from 8.5.0 to 8.8.1 (#8620) Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 8.5.0 to 8.8.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.8.1/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 48 +++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0368f230c..e7901d917 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1261,15 +1261,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.5.0.tgz", - "integrity": "sha512-gF77eNv0Xz2UJg/NbpWJ0kqAm35UMsvZf1GHj8D9MRFTj/V3tAciIWXfmPLsAAF/vUlpWPvUDyH1jjsr0cMVWw==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.8.1.tgz", + "integrity": "sha512-hQUVn2Lij2NAxVFEdvIGxT9gP1tq2yM83m+by3whWFsWC+1y8pxxxHUFE1UqDu2VsGi2i6RLcv4QvouM84U+ow==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "8.5.0", - "@typescript-eslint/types": "8.5.0", - "@typescript-eslint/typescript-estree": "8.5.0", - "@typescript-eslint/visitor-keys": "8.5.0", + "@typescript-eslint/scope-manager": "8.8.1", + "@typescript-eslint/types": "8.8.1", + "@typescript-eslint/typescript-estree": "8.8.1", + "@typescript-eslint/visitor-keys": "8.8.1", "debug": "^4.3.4" }, "engines": { @@ -1289,13 +1289,13 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.5.0.tgz", - "integrity": "sha512-06JOQ9Qgj33yvBEx6tpC8ecP9o860rsR22hWMEd12WcTRrfaFgHr2RB/CA/B+7BMhHkXT4chg2MyboGdFGawYg==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.8.1.tgz", + "integrity": "sha512-X4JdU+66Mazev/J0gfXlcC/dV6JI37h+93W9BRYXrSn0hrE64IoWgVkO9MSJgEzoWkxONgaQpICWg8vAN74wlA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.5.0", - "@typescript-eslint/visitor-keys": "8.5.0" + "@typescript-eslint/types": "8.8.1", + "@typescript-eslint/visitor-keys": "8.8.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1306,9 +1306,9 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.5.0.tgz", - "integrity": "sha512-qjkormnQS5wF9pjSi6q60bKUHH44j2APxfh9TQRXK8wbYVeDYYdYJGIROL87LGZZ2gz3Rbmjc736qyL8deVtdw==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.8.1.tgz", + "integrity": "sha512-WCcTP4SDXzMd23N27u66zTKMuEevH4uzU8C9jf0RO4E04yVHgQgW+r+TeVTNnO1KIfrL8ebgVVYYMMO3+jC55Q==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1319,13 +1319,13 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.5.0.tgz", - "integrity": "sha512-vEG2Sf9P8BPQ+d0pxdfndw3xIXaoSjliG0/Ejk7UggByZPKXmJmw3GW5jV2gHNQNawBUyfahoSiCFVov0Ruf7Q==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.8.1.tgz", + "integrity": "sha512-A5d1R9p+X+1js4JogdNilDuuq+EHZdsH9MjTVxXOdVFfTJXunKJR/v+fNNyO4TnoOn5HqobzfRlc70NC6HTcdg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.5.0", - "@typescript-eslint/visitor-keys": "8.5.0", + "@typescript-eslint/types": "8.8.1", + "@typescript-eslint/visitor-keys": "8.8.1", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -1347,12 +1347,12 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.5.0.tgz", - "integrity": "sha512-yTPqMnbAZJNy2Xq2XU8AdtOW9tJIr+UQb64aXB9f3B1498Zx9JorVgFJcZpEc9UBuCCrdzKID2RGAMkYcDtZOw==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.8.1.tgz", + "integrity": "sha512-0/TdC3aeRAsW7MDvYRwEc1Uwm0TIBfzjPFgg60UU2Haj5qsCs9cc3zNgY71edqE3LbWfF/WoZQd3lJoDXFQpag==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.5.0", + "@typescript-eslint/types": "8.8.1", "eslint-visitor-keys": "^3.4.3" }, "engines": { From 4a0b26f0ebe998549b031a18f61d99564f340795 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 14:40:59 -0700 Subject: [PATCH 63/90] chore(deps): bump jsdom from 25.0.0 to 25.0.1 (#8604) Bumps [jsdom](https://github.com/jsdom/jsdom) from 25.0.0 to 25.0.1. - [Release notes](https://github.com/jsdom/jsdom/releases) - [Changelog](https://github.com/jsdom/jsdom/blob/main/Changelog.md) - [Commits](https://github.com/jsdom/jsdom/compare/25.0.0...25.0.1) --- updated-dependencies: - dependency-name: jsdom dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 108 +++++++++++++++++++--------------------------- package.json | 2 +- 2 files changed, 46 insertions(+), 64 deletions(-) diff --git a/package-lock.json b/package-lock.json index e7901d917..5333addb0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "jsdom": "25.0.0" + "jsdom": "25.0.1" }, "devDependencies": { "@blockly/block-test": "^6.0.4", @@ -3168,6 +3168,17 @@ "node": ">=0.10.0" } }, + "node_modules/cssstyle": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.1.0.tgz", + "integrity": "sha512-h66W1URKpBS5YMI/V8PyXvTMFT8SupJ1IzoIV8IeBC/ji8WVmrO8dGlTi+2dh6whmdk6BiKJLD/ZBkhWbcg6nA==", + "dependencies": { + "rrweb-cssom": "^0.7.1" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/d": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", @@ -5901,11 +5912,11 @@ } }, "node_modules/jsdom": { - "version": "25.0.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-25.0.0.tgz", - "integrity": "sha512-OhoFVT59T7aEq75TVw9xxEfkXgacpqAhQaYgP9y/fDqWQCMB/b1H66RfmPm/MaeaAIU9nDwMOVTlPN51+ao6CQ==", + "version": "25.0.1", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-25.0.1.tgz", + "integrity": "sha512-8i7LzZj7BF8uplX+ZyOlIz86V6TAsSs+np6m1kpW9u0JWi4z/1t+FzcK1aek+ybTnAC4KhBL4uXCNT0wcUIeCw==", "dependencies": { - "cssstyle": "^4.0.1", + "cssstyle": "^4.1.0", "data-urls": "^5.0.0", "decimal.js": "^10.4.3", "form-data": "^4.0.0", @@ -5918,7 +5929,7 @@ "rrweb-cssom": "^0.7.1", "saxes": "^6.0.0", "symbol-tree": "^3.2.4", - "tough-cookie": "^4.1.4", + "tough-cookie": "^5.0.0", "w3c-xmlserializer": "^5.0.0", "webidl-conversions": "^7.0.0", "whatwg-encoding": "^3.1.1", @@ -5939,22 +5950,6 @@ } } }, - "node_modules/jsdom/node_modules/cssstyle": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.0.1.tgz", - "integrity": "sha512-8ZYiJ3A/3OkDd093CBT/0UKDWry7ak4BdPTFP2+QEP7cmhouyq/Up709ASSj2cK02BbZiMgk7kYjZNS4QP5qrQ==", - "dependencies": { - "rrweb-cssom": "^0.6.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/jsdom/node_modules/cssstyle/node_modules/rrweb-cssom": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", - "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==" - }, "node_modules/jsdom/node_modules/html-encoding-sniffer": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz", @@ -5966,11 +5961,6 @@ "node": ">=18" } }, - "node_modules/jsdom/node_modules/rrweb-cssom": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.7.1.tgz", - "integrity": "sha512-TrEMa7JGdVm0UThDJSx7ddw5nVm3UJS9o9CCIZ72B1vSyEZoziDqBYP3XIoi/12lKrJR8rE3jeFHMok2F/Mnsg==" - }, "node_modules/jsdom/node_modules/tr46": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.0.0.tgz", @@ -7417,11 +7407,6 @@ "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", "dev": true }, - "node_modules/psl": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", - "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==" - }, "node_modules/pump": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz", @@ -7455,11 +7440,6 @@ "integrity": "sha512-lT5yCqEBgfoMYpf3F2xQRK7zEr1rhIIZuceDK6+xRkJQ4NMbHTwXqk4NkwDwQMNqXgG9r9fyHnzwNVs6zV5KRw==", "dev": true }, - "node_modules/querystringify": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", - "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==" - }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -7652,7 +7632,8 @@ "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", + "dev": true }, "node_modules/resolve": { "version": "1.22.8", @@ -7751,6 +7732,11 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/rrweb-cssom": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.7.1.tgz", + "integrity": "sha512-TrEMa7JGdVm0UThDJSx7ddw5nVm3UJS9o9CCIZ72B1vSyEZoziDqBYP3XIoi/12lKrJR8rE3jeFHMok2F/Mnsg==" + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -8411,6 +8397,22 @@ "next-tick": "1" } }, + "node_modules/tldts": { + "version": "6.1.48", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.48.tgz", + "integrity": "sha512-SPbnh1zaSzi/OsmHb1vrPNnYuwJbdWjwo5TbBYYMlTtH3/1DSb41t8bcSxkwDmmbG2q6VLPVvQc7Yf23T+1EEw==", + "dependencies": { + "tldts-core": "^6.1.48" + }, + "bin": { + "tldts": "bin/cli.js" + } + }, + "node_modules/tldts-core": { + "version": "6.1.48", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.48.tgz", + "integrity": "sha512-3gD9iKn/n2UuFH1uilBviK9gvTNT6iYwdqrj1Vr5mh8FuelvpRNaYVH4pNYqUgOGU4aAdL9X35eLuuj0gRsx+A==" + }, "node_modules/tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -8448,25 +8450,14 @@ } }, "node_modules/tough-cookie": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz", - "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.0.0.tgz", + "integrity": "sha512-FRKsF7cz96xIIeMZ82ehjC3xW2E+O2+v11udrDYewUbszngYhsGa8z6YUMMzO9QJZzzyd0nGGXnML/TReX6W8Q==", "dependencies": { - "psl": "^1.1.33", - "punycode": "^2.1.1", - "universalify": "^0.2.0", - "url-parse": "^1.5.3" + "tldts": "^6.1.32" }, "engines": { - "node": ">=6" - } - }, - "node_modules/tough-cookie/node_modules/universalify": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", - "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", - "engines": { - "node": ">= 4.0.0" + "node": ">=16" } }, "node_modules/tree-kill": { @@ -8657,15 +8648,6 @@ "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==", "dev": true }, - "node_modules/url-parse": { - "version": "1.5.10", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", - "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", - "dependencies": { - "querystringify": "^2.1.1", - "requires-port": "^1.0.0" - } - }, "node_modules/urlpattern-polyfill": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-10.0.0.tgz", diff --git a/package.json b/package.json index 484295182..9fcdada41 100644 --- a/package.json +++ b/package.json @@ -143,7 +143,7 @@ "yargs": "^17.2.1" }, "dependencies": { - "jsdom": "25.0.0" + "jsdom": "25.0.1" }, "engines": { "node": ">=18" From 60da7d87625080ee44093c45a56689456883d6f6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 14:41:13 -0700 Subject: [PATCH 64/90] chore(deps): bump @microsoft/api-extractor from 7.47.0 to 7.47.9 (#8612) Bumps [@microsoft/api-extractor](https://github.com/microsoft/rushstack/tree/HEAD/apps/api-extractor) from 7.47.0 to 7.47.9. - [Changelog](https://github.com/microsoft/rushstack/blob/main/apps/api-extractor/CHANGELOG.md) - [Commits](https://github.com/microsoft/rushstack/commits/@microsoft/api-extractor_v7.47.9/apps/api-extractor) --- updated-dependencies: - dependency-name: "@microsoft/api-extractor" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 154 ++++++++-------------------------------------- 1 file changed, 26 insertions(+), 128 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5333addb0..c454c971a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -634,87 +634,6 @@ "api-documenter": "bin/api-documenter" } }, - "node_modules/@microsoft/api-documenter/node_modules/@microsoft/api-extractor-model": { - "version": "7.29.8", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.29.8.tgz", - "integrity": "sha512-t3Z/xcO6TRbMcnKGVMs4uMzv/gd5j0NhMiJIGjD4cJMeFJ1Hf8wnLSx37vxlRlL0GWlGJhnFgxvnaL6JlS+73g==", - "dev": true, - "dependencies": { - "@microsoft/tsdoc": "~0.15.0", - "@microsoft/tsdoc-config": "~0.17.0", - "@rushstack/node-core-library": "5.9.0" - } - }, - "node_modules/@microsoft/api-documenter/node_modules/@rushstack/node-core-library": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-5.9.0.tgz", - "integrity": "sha512-MMsshEWkTbXqxqFxD4gcIUWQOCeBChlGczdZbHfqmNZQFLHB3yWxDFSMHFUdu2/OB9NUk7Awn5qRL+rws4HQNg==", - "dev": true, - "dependencies": { - "ajv": "~8.13.0", - "ajv-draft-04": "~1.0.0", - "ajv-formats": "~3.0.1", - "fs-extra": "~7.0.1", - "import-lazy": "~4.0.0", - "jju": "~1.4.0", - "resolve": "~1.22.1", - "semver": "~7.5.4" - }, - "peerDependencies": { - "@types/node": "*" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - } - } - }, - "node_modules/@microsoft/api-documenter/node_modules/@rushstack/terminal": { - "version": "0.14.2", - "resolved": "https://registry.npmjs.org/@rushstack/terminal/-/terminal-0.14.2.tgz", - "integrity": "sha512-2fC1wqu1VCExKC0/L+0noVcFQEXEnoBOtCIex1TOjBzEDWcw8KzJjjj7aTP6mLxepG0XIyn9OufeFb6SFsa+sg==", - "dev": true, - "dependencies": { - "@rushstack/node-core-library": "5.9.0", - "supports-color": "~8.1.1" - }, - "peerDependencies": { - "@types/node": "*" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - } - } - }, - "node_modules/@microsoft/api-documenter/node_modules/@rushstack/ts-command-line": { - "version": "4.22.8", - "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.22.8.tgz", - "integrity": "sha512-XbFjOoV7qZHJnSuFUHv0pKaFA4ixyCuki+xMjsMfDwfvQjs5MYG0IK5COal3tRnG7KCDe2l/G+9LrzYE/RJhgg==", - "dev": true, - "dependencies": { - "@rushstack/terminal": "0.14.2", - "@types/argparse": "1.0.38", - "argparse": "~1.0.9", - "string-argv": "~0.3.1" - } - }, - "node_modules/@microsoft/api-documenter/node_modules/ajv": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.13.0.tgz", - "integrity": "sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.3", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.4.1" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/@microsoft/api-documenter/node_modules/argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -737,40 +656,19 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/@microsoft/api-documenter/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, - "node_modules/@microsoft/api-documenter/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, "node_modules/@microsoft/api-extractor": { - "version": "7.47.0", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.47.0.tgz", - "integrity": "sha512-LT8yvcWNf76EpDC+8/ArTVSYePvuDQ+YbAUrsTcpg3ptiZ93HIcMCozP/JOxDt+rrsFfFHcpfoselKfPyRI0GQ==", + "version": "7.47.9", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.47.9.tgz", + "integrity": "sha512-TTq30M1rikVsO5wZVToQT/dGyJY7UXJmjiRtkHPLb74Prx3Etw8+bX7Bv7iLuby6ysb7fuu1NFWqma+csym8Jw==", "dev": true, "dependencies": { - "@microsoft/api-extractor-model": "7.29.2", + "@microsoft/api-extractor-model": "7.29.8", "@microsoft/tsdoc": "~0.15.0", "@microsoft/tsdoc-config": "~0.17.0", - "@rushstack/node-core-library": "5.4.1", - "@rushstack/rig-package": "0.5.2", - "@rushstack/terminal": "0.13.0", - "@rushstack/ts-command-line": "4.22.0", + "@rushstack/node-core-library": "5.9.0", + "@rushstack/rig-package": "0.5.3", + "@rushstack/terminal": "0.14.2", + "@rushstack/ts-command-line": "4.22.8", "lodash": "~4.17.15", "minimatch": "~3.0.3", "resolve": "~1.22.1", @@ -783,14 +681,14 @@ } }, "node_modules/@microsoft/api-extractor-model": { - "version": "7.29.2", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.29.2.tgz", - "integrity": "sha512-hAYajOjQan3uslhKJRwvvHIdLJ+ZByKqdSsJ/dgHFxPtEbdKpzMDO8zuW4K5gkSMYl5D0LbNwxkhxr51P2zsmw==", + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.29.8.tgz", + "integrity": "sha512-t3Z/xcO6TRbMcnKGVMs4uMzv/gd5j0NhMiJIGjD4cJMeFJ1Hf8wnLSx37vxlRlL0GWlGJhnFgxvnaL6JlS+73g==", "dev": true, "dependencies": { "@microsoft/tsdoc": "~0.15.0", "@microsoft/tsdoc-config": "~0.17.0", - "@rushstack/node-core-library": "5.4.1" + "@rushstack/node-core-library": "5.9.0" } }, "node_modules/@microsoft/api-extractor/node_modules/minimatch": { @@ -978,9 +876,9 @@ } }, "node_modules/@rushstack/node-core-library": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-5.4.1.tgz", - "integrity": "sha512-WNnwdS8r9NZ/2K3u29tNoSRldscFa7SxU0RT+82B6Dy2I4Hl2MeCSKm4EXLXPKeNzLGvJ1cqbUhTLviSF8E6iA==", + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-5.9.0.tgz", + "integrity": "sha512-MMsshEWkTbXqxqFxD4gcIUWQOCeBChlGczdZbHfqmNZQFLHB3yWxDFSMHFUdu2/OB9NUk7Awn5qRL+rws4HQNg==", "dev": true, "dependencies": { "ajv": "~8.13.0", @@ -1024,9 +922,9 @@ "dev": true }, "node_modules/@rushstack/rig-package": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.5.2.tgz", - "integrity": "sha512-mUDecIJeH3yYGZs2a48k+pbhM6JYwWlgjs2Ca5f2n1G2/kgdgP9D/07oglEGf6mRyXEnazhEENeYTSNDRCwdqA==", + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.5.3.tgz", + "integrity": "sha512-olzSSjYrvCNxUFZowevC3uz8gvKr3WTpHQ7BkpjtRpA3wK+T0ybep/SRUMfr195gBzJm5gaXw0ZMgjIyHqJUow==", "dev": true, "dependencies": { "resolve": "~1.22.1", @@ -1034,12 +932,12 @@ } }, "node_modules/@rushstack/terminal": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/@rushstack/terminal/-/terminal-0.13.0.tgz", - "integrity": "sha512-Ou44Q2s81BqJu3dpYedAX54am9vn245F0HzqVrfJCMQk5pGgoKKOBOjkbfZC9QKcGNaECh6pwH2s5noJt7X6ew==", + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/@rushstack/terminal/-/terminal-0.14.2.tgz", + "integrity": "sha512-2fC1wqu1VCExKC0/L+0noVcFQEXEnoBOtCIex1TOjBzEDWcw8KzJjjj7aTP6mLxepG0XIyn9OufeFb6SFsa+sg==", "dev": true, "dependencies": { - "@rushstack/node-core-library": "5.4.1", + "@rushstack/node-core-library": "5.9.0", "supports-color": "~8.1.1" }, "peerDependencies": { @@ -1067,12 +965,12 @@ } }, "node_modules/@rushstack/ts-command-line": { - "version": "4.22.0", - "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.22.0.tgz", - "integrity": "sha512-Qj28t6MO3HRgAZ72FDeFsrpdE6wBWxF3VENgvrXh7JF2qIT+CrXiOJIesW80VFZB9QwObSpkB1ilx794fGQg6g==", + "version": "4.22.8", + "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.22.8.tgz", + "integrity": "sha512-XbFjOoV7qZHJnSuFUHv0pKaFA4ixyCuki+xMjsMfDwfvQjs5MYG0IK5COal3tRnG7KCDe2l/G+9LrzYE/RJhgg==", "dev": true, "dependencies": { - "@rushstack/terminal": "0.13.0", + "@rushstack/terminal": "0.14.2", "@types/argparse": "1.0.38", "argparse": "~1.0.9", "string-argv": "~0.3.1" From edc8473f772ed3faa8579c82771dcac28a302c02 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 08:27:32 -0700 Subject: [PATCH 65/90] chore(deps): bump typescript from 5.5.4 to 5.6.3 (#8623) Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.5.4 to 5.6.3. - [Release notes](https://github.com/microsoft/TypeScript/releases) - [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml) - [Commits](https://github.com/microsoft/TypeScript/compare/v5.5.4...v5.6.3) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index c454c971a..17b354f44 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8431,9 +8431,9 @@ "dev": true }, "node_modules/typescript": { - "version": "5.5.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", - "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", + "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", "dev": true, "bin": { "tsc": "bin/tsc", From 437f6a3d93ba3f0affd542391c9ac2c8baa423d8 Mon Sep 17 00:00:00 2001 From: John Nesky Date: Fri, 25 Oct 2024 11:37:55 -0700 Subject: [PATCH 66/90] fix: bump initiator group in an orthogonal direction from neighboring group (#8613) * fix: bump connected connections in a different direction * Bump initiator block group in orthogonal direction. * Revert the wording of a doc comment. * Addressing PR feedback. --- core/block_svg.ts | 4 +- core/connection.ts | 6 +- core/rendered_connection.ts | 110 ++++++++++++++++++++++-------------- 3 files changed, 73 insertions(+), 47 deletions(-) diff --git a/core/block_svg.ts b/core/block_svg.ts index 9797a50e7..605d25fd4 100644 --- a/core/block_svg.ts +++ b/core/block_svg.ts @@ -1472,9 +1472,9 @@ export class BlockSvg if (conn.isConnected() && neighbour.isConnected()) continue; if (conn.isSuperior()) { - neighbour.bumpAwayFrom(conn); + neighbour.bumpAwayFrom(conn, /* initiatedByThis = */ false); } else { - conn.bumpAwayFrom(neighbour); + conn.bumpAwayFrom(neighbour, /* initiatedByThis = */ true); } } } diff --git a/core/connection.ts b/core/connection.ts index 93caf5bcf..9cc2c28a9 100644 --- a/core/connection.ts +++ b/core/connection.ts @@ -214,11 +214,11 @@ export class Connection implements IASTNodeLocationWithBlock { * Called when an attempted connection fails. NOP by default (i.e. for * headless workspaces). * - * @param _otherConnection Connection that this connection failed to connect - * to. + * @param _superiorConnection Connection that this connection failed to connect + * to. The provided connection should be the superior connection. * @internal */ - onFailedConnect(_otherConnection: Connection) {} + onFailedConnect(_superiorConnection: Connection) {} // NOP /** diff --git a/core/rendered_connection.ts b/core/rendered_connection.ts index 27c532839..f73dc0628 100644 --- a/core/rendered_connection.ts +++ b/core/rendered_connection.ts @@ -117,59 +117,85 @@ export class RenderedConnection extends Connection { * Move the block(s) belonging to the connection to a point where they don't * visually interfere with the specified connection. * - * @param staticConnection The connection to move away from. + * @param superiorConnection The connection to move away from. The provided + * connection should be the superior connection and should not be + * connected to this connection. + * @param initiatedByThis Whether or not the block group that was manipulated + * recently causing bump checks is associated with the inferior + * connection. Defaults to false. * @internal */ - bumpAwayFrom(staticConnection: RenderedConnection) { + bumpAwayFrom( + superiorConnection: RenderedConnection, + initiatedByThis = false, + ) { if (this.sourceBlock_.workspace.isDragging()) { // Don't move blocks around while the user is doing the same. return; } - // Move the root block. - let rootBlock = this.sourceBlock_.getRootBlock(); - if (rootBlock.isInFlyout) { + let offsetX = + config.snapRadius + Math.floor(Math.random() * BUMP_RANDOMNESS); + let offsetY = + config.snapRadius + Math.floor(Math.random() * BUMP_RANDOMNESS); + /* eslint-disable-next-line @typescript-eslint/no-this-alias */ + const inferiorConnection = this; + const superiorRootBlock = superiorConnection.sourceBlock_.getRootBlock(); + const inferiorRootBlock = inferiorConnection.sourceBlock_.getRootBlock(); + + if (superiorRootBlock.isInFlyout || inferiorRootBlock.isInFlyout) { // Don't move blocks around in a flyout. return; } - let reverse = false; - if (!rootBlock.isMovable()) { - // Can't bump an uneditable block away. + let moveInferior = true; + if (!inferiorRootBlock.isMovable()) { + // Can't bump an immovable block away. // Check to see if the other block is movable. - rootBlock = staticConnection.getSourceBlock().getRootBlock(); - if (!rootBlock.isMovable()) { + if (!superiorRootBlock.isMovable()) { + // Neither block is movable, abort operation. return; + } else { + // Only the superior block group is movable. + moveInferior = false; + // The superior block group moves in the opposite direction. + offsetX = -offsetX; + offsetY = -offsetY; + } + } else if (superiorRootBlock.isMovable()) { + // Both block groups are movable. The one on the inferior side will be + // moved to make space for the superior one. However, it's possible that + // both groups of blocks have an inferior connection that bumps into a + // superior connection on the other group, which could result in both + // groups moving in the same direction and eventually bumping each other + // again. It would be better if one group of blocks could consistently + // move in an orthogonal direction from the other, so that they become + // separated in the end. We can designate one group the "initiator" if + // it's the one that was most recently manipulated, causing inputs to be + // checked for bumpable neighbors. As a useful heuristic, in the case + // where the inferior connection belongs to the initiator group, moving it + // in the orthogonal direction will separate the blocks better. + if (initiatedByThis) { + offsetY = -offsetY; } - // Swap the connections and move the 'static' connection instead. - /* eslint-disable-next-line @typescript-eslint/no-this-alias */ - staticConnection = this; - reverse = true; } + const staticConnection = moveInferior + ? superiorConnection + : inferiorConnection; + const dynamicConnection = moveInferior + ? inferiorConnection + : superiorConnection; + const dynamicRootBlock = moveInferior + ? inferiorRootBlock + : superiorRootBlock; // Raise it to the top for extra visibility. - const selected = common.getSelected() == rootBlock; - if (!selected) rootBlock.addSelect(); - let dx = - staticConnection.x + - config.snapRadius + - Math.floor(Math.random() * BUMP_RANDOMNESS) - - this.x; - let dy = - staticConnection.y + - config.snapRadius + - Math.floor(Math.random() * BUMP_RANDOMNESS) - - this.y; - if (reverse) { - // When reversing a bump due to an uneditable block, bump up. - dy = -dy; + const selected = common.getSelected() === dynamicRootBlock; + if (!selected) dynamicRootBlock.addSelect(); + if (dynamicRootBlock.RTL) { + offsetX = -offsetX; } - if (rootBlock.RTL) { - dx = - staticConnection.x - - config.snapRadius - - Math.floor(Math.random() * BUMP_RANDOMNESS) - - this.x; - } - rootBlock.moveBy(dx, dy, ['bump']); - if (!selected) rootBlock.removeSelect(); + const dx = staticConnection.x + offsetX - dynamicConnection.x; + const dy = staticConnection.y + offsetY - dynamicConnection.y; + dynamicRootBlock.moveBy(dx, dy, ['bump']); + if (!selected) dynamicRootBlock.removeSelect(); } /** @@ -413,11 +439,11 @@ export class RenderedConnection extends Connection { * Bumps this connection away from the other connection. Called when an * attempted connection fails. * - * @param otherConnection Connection that this connection failed to connect - * to. + * @param superiorConnection Connection that this connection failed to connect + * to. The provided connection should be the superior connection. * @internal */ - override onFailedConnect(otherConnection: Connection) { + override onFailedConnect(superiorConnection: Connection) { const block = this.getSourceBlock(); if (eventUtils.getRecordUndo()) { const group = eventUtils.getGroup(); @@ -425,7 +451,7 @@ export class RenderedConnection extends Connection { function (this: RenderedConnection) { if (!block.isDisposed() && !block.getParent()) { eventUtils.setGroup(group); - this.bumpAwayFrom(otherConnection as RenderedConnection); + this.bumpAwayFrom(superiorConnection as RenderedConnection); eventUtils.setGroup(false); } }.bind(this), From 1d2590354f95c450784ba268751f3ad1f7531d9e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 11:06:05 -0700 Subject: [PATCH 67/90] chore(deps): bump @typescript-eslint/parser from 8.8.1 to 8.11.0 (#8629) Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 8.8.1 to 8.11.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.11.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 48 +++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/package-lock.json b/package-lock.json index 17b354f44..3d96af22f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1159,15 +1159,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.8.1.tgz", - "integrity": "sha512-hQUVn2Lij2NAxVFEdvIGxT9gP1tq2yM83m+by3whWFsWC+1y8pxxxHUFE1UqDu2VsGi2i6RLcv4QvouM84U+ow==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.11.0.tgz", + "integrity": "sha512-lmt73NeHdy1Q/2ul295Qy3uninSqi6wQI18XwSpm8w0ZbQXUpjCAWP1Vlv/obudoBiIjJVjlztjQ+d/Md98Yxg==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "8.8.1", - "@typescript-eslint/types": "8.8.1", - "@typescript-eslint/typescript-estree": "8.8.1", - "@typescript-eslint/visitor-keys": "8.8.1", + "@typescript-eslint/scope-manager": "8.11.0", + "@typescript-eslint/types": "8.11.0", + "@typescript-eslint/typescript-estree": "8.11.0", + "@typescript-eslint/visitor-keys": "8.11.0", "debug": "^4.3.4" }, "engines": { @@ -1187,13 +1187,13 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.8.1.tgz", - "integrity": "sha512-X4JdU+66Mazev/J0gfXlcC/dV6JI37h+93W9BRYXrSn0hrE64IoWgVkO9MSJgEzoWkxONgaQpICWg8vAN74wlA==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.11.0.tgz", + "integrity": "sha512-Uholz7tWhXmA4r6epo+vaeV7yjdKy5QFCERMjs1kMVsLRKIrSdM6o21W2He9ftp5PP6aWOVpD5zvrvuHZC0bMQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.8.1", - "@typescript-eslint/visitor-keys": "8.8.1" + "@typescript-eslint/types": "8.11.0", + "@typescript-eslint/visitor-keys": "8.11.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1204,9 +1204,9 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.8.1.tgz", - "integrity": "sha512-WCcTP4SDXzMd23N27u66zTKMuEevH4uzU8C9jf0RO4E04yVHgQgW+r+TeVTNnO1KIfrL8ebgVVYYMMO3+jC55Q==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.11.0.tgz", + "integrity": "sha512-tn6sNMHf6EBAYMvmPUaKaVeYvhUsrE6x+bXQTxjQRp360h1giATU0WvgeEys1spbvb5R+VpNOZ+XJmjD8wOUHw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1217,13 +1217,13 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.8.1.tgz", - "integrity": "sha512-A5d1R9p+X+1js4JogdNilDuuq+EHZdsH9MjTVxXOdVFfTJXunKJR/v+fNNyO4TnoOn5HqobzfRlc70NC6HTcdg==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.11.0.tgz", + "integrity": "sha512-yHC3s1z1RCHoCz5t06gf7jH24rr3vns08XXhfEqzYpd6Hll3z/3g23JRi0jM8A47UFKNc3u/y5KIMx8Ynbjohg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.8.1", - "@typescript-eslint/visitor-keys": "8.8.1", + "@typescript-eslint/types": "8.11.0", + "@typescript-eslint/visitor-keys": "8.11.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -1245,12 +1245,12 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.8.1.tgz", - "integrity": "sha512-0/TdC3aeRAsW7MDvYRwEc1Uwm0TIBfzjPFgg60UU2Haj5qsCs9cc3zNgY71edqE3LbWfF/WoZQd3lJoDXFQpag==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.11.0.tgz", + "integrity": "sha512-EaewX6lxSjRJnc+99+dqzTeoDZUfyrA52d2/HRrkI830kgovWsmIiTfmr0NZorzqic7ga+1bS60lRBUgR3n/Bw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.8.1", + "@typescript-eslint/types": "8.11.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { From 6a674002cc893d40671810f9ad2f84a9d5aa84a4 Mon Sep 17 00:00:00 2001 From: Richard Knoll Date: Mon, 28 Oct 2024 13:05:31 -0700 Subject: [PATCH 68/90] fix: clear touch identifier on comment icon down (#8627) --- core/comments/comment_view.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/comments/comment_view.ts b/core/comments/comment_view.ts index bd90c7576..99c14aaa8 100644 --- a/core/comments/comment_view.ts +++ b/core/comments/comment_view.ts @@ -623,6 +623,7 @@ export class CommentView implements IRenderedElement { * event on the foldout icon. */ private onFoldoutDown(e: PointerEvent) { + touch.clearTouchIdentifier(); this.bringToFront(); if (browserEvents.isRightButton(e)) { e.stopPropagation(); @@ -738,6 +739,7 @@ export class CommentView implements IRenderedElement { * delete icon. */ private onDeleteDown(e: PointerEvent) { + touch.clearTouchIdentifier(); if (browserEvents.isRightButton(e)) { e.stopPropagation(); return; From 0d88280faa138aa96b9f58fb13b0dab39fc520a1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Nov 2024 18:50:26 +0000 Subject: [PATCH 69/90] chore(deps): bump @microsoft/api-extractor from 7.47.9 to 7.47.11 (#8622) Bumps [@microsoft/api-extractor](https://github.com/microsoft/rushstack/tree/HEAD/apps/api-extractor) from 7.47.9 to 7.47.11. - [Changelog](https://github.com/microsoft/rushstack/blob/main/apps/api-extractor/CHANGELOG.md) - [Commits](https://github.com/microsoft/rushstack/commits/@microsoft/api-extractor_v7.47.11/apps/api-extractor) --- updated-dependencies: - dependency-name: "@microsoft/api-extractor" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3d96af22f..19a37cfa0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -657,9 +657,9 @@ } }, "node_modules/@microsoft/api-extractor": { - "version": "7.47.9", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.47.9.tgz", - "integrity": "sha512-TTq30M1rikVsO5wZVToQT/dGyJY7UXJmjiRtkHPLb74Prx3Etw8+bX7Bv7iLuby6ysb7fuu1NFWqma+csym8Jw==", + "version": "7.47.11", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.47.11.tgz", + "integrity": "sha512-lrudfbPub5wzBhymfFtgZKuBvXxoSIAdrvS2UbHjoMT2TjIEddq6Z13pcve7A03BAouw0x8sW8G4txdgfiSwpQ==", "dev": true, "dependencies": { "@microsoft/api-extractor-model": "7.29.8", @@ -668,7 +668,7 @@ "@rushstack/node-core-library": "5.9.0", "@rushstack/rig-package": "0.5.3", "@rushstack/terminal": "0.14.2", - "@rushstack/ts-command-line": "4.22.8", + "@rushstack/ts-command-line": "4.23.0", "lodash": "~4.17.15", "minimatch": "~3.0.3", "resolve": "~1.22.1", @@ -691,6 +691,27 @@ "@rushstack/node-core-library": "5.9.0" } }, + "node_modules/@microsoft/api-extractor/node_modules/@rushstack/ts-command-line": { + "version": "4.23.0", + "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.23.0.tgz", + "integrity": "sha512-jYREBtsxduPV6ptNq8jOKp9+yx0ld1Tb/Tkdnlj8gTjazl1sF3DwX2VbluyYrNd0meWIL0bNeer7WDf5tKFjaQ==", + "dev": true, + "dependencies": { + "@rushstack/terminal": "0.14.2", + "@types/argparse": "1.0.38", + "argparse": "~1.0.9", + "string-argv": "~0.3.1" + } + }, + "node_modules/@microsoft/api-extractor/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, "node_modules/@microsoft/api-extractor/node_modules/minimatch": { "version": "3.0.8", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz", From d053008b800567e194fba217b93b3df08451e129 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Nov 2024 19:00:57 +0000 Subject: [PATCH 70/90] chore(deps): bump google-github-actions/deploy-appengine (#8630) Bumps [google-github-actions/deploy-appengine](https://github.com/google-github-actions/deploy-appengine) from 2.1.3 to 2.1.4. - [Release notes](https://github.com/google-github-actions/deploy-appengine/releases) - [Changelog](https://github.com/google-github-actions/deploy-appengine/blob/main/CHANGELOG.md) - [Commits](https://github.com/google-github-actions/deploy-appengine/compare/v2.1.3...v2.1.4) --- updated-dependencies: - dependency-name: google-github-actions/deploy-appengine dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/appengine_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/appengine_deploy.yml b/.github/workflows/appengine_deploy.yml index 438d2f094..938a16fc7 100644 --- a/.github/workflows/appengine_deploy.yml +++ b/.github/workflows/appengine_deploy.yml @@ -42,7 +42,7 @@ jobs: path: _deploy/ - name: Deploy to App Engine - uses: google-github-actions/deploy-appengine@v2.1.3 + uses: google-github-actions/deploy-appengine@v2.1.4 # For parameters see: # https://github.com/google-github-actions/deploy-appengine#inputs with: From aedcfd6da58e7f5dafadb6b4c55ddf4bc9d2a9aa Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Mon, 4 Nov 2024 09:43:17 -0800 Subject: [PATCH 71/90] fix: Use a readonly textarea for non-editable comments. (#8632) * fix: Use a readonly textarea for non-editable comments. * chore: Run formatter. * chore: remove old function definition --- core/bubbles/textinput_bubble.ts | 17 +++++++++++++++ core/icons/comment_icon.ts | 36 ++++++++++++-------------------- tests/mocha/comment_test.js | 6 +++--- 3 files changed, 33 insertions(+), 26 deletions(-) diff --git a/core/bubbles/textinput_bubble.ts b/core/bubbles/textinput_bubble.ts index befbb2f21..5b5278b91 100644 --- a/core/bubbles/textinput_bubble.ts +++ b/core/bubbles/textinput_bubble.ts @@ -63,6 +63,8 @@ export class TextInputBubble extends Bubble { 20 + Bubble.DOUBLE_BORDER, ); + private editable = true; + /** * @param workspace The workspace this bubble belongs to. * @param anchor The anchor location of the thing this bubble is attached to. @@ -96,6 +98,21 @@ export class TextInputBubble extends Bubble { this.onTextChange(); } + /** Sets whether or not the text in the bubble is editable. */ + setEditable(editable: boolean) { + this.editable = editable; + if (this.editable) { + this.textArea.removeAttribute('readonly'); + } else { + this.textArea.setAttribute('readonly', ''); + } + } + + /** Returns whether or not the text in the bubble is editable. */ + isEditable(): boolean { + return this.editable; + } + /** Adds a change listener to be notified when this bubble's text changes. */ addTextChangeListener(listener: () => void) { this.textChangeListeners.push(listener); diff --git a/core/icons/comment_icon.ts b/core/icons/comment_icon.ts index 7cf5431d7..8cdf77918 100644 --- a/core/icons/comment_icon.ts +++ b/core/icons/comment_icon.ts @@ -8,7 +8,6 @@ import type {Block} from '../block.js'; import type {BlockSvg} from '../block_svg.js'; -import {TextBubble} from '../bubbles/text_bubble.js'; import {TextInputBubble} from '../bubbles/textinput_bubble.js'; import {EventType} from '../events/type.js'; import * as eventUtils from '../events/utils.js'; @@ -47,12 +46,9 @@ export class CommentIcon extends Icon implements IHasBubble, ISerializable { */ static readonly WEIGHT = 3; - /** The bubble used to show editable text to the user. */ + /** The bubble used to show comment text to the user. */ private textInputBubble: TextInputBubble | null = null; - /** The bubble used to show non-editable text to the user. */ - private textBubble: TextBubble | null = null; - /** The text of this comment. */ private text = ''; @@ -118,7 +114,6 @@ export class CommentIcon extends Icon implements IHasBubble, ISerializable { override dispose() { super.dispose(); this.textInputBubble?.dispose(); - this.textBubble?.dispose(); } override getWeight(): number { @@ -133,7 +128,6 @@ export class CommentIcon extends Icon implements IHasBubble, ISerializable { super.applyColour(); const colour = (this.sourceBlock as BlockSvg).style.colourPrimary; this.textInputBubble?.setColour(colour); - this.textBubble?.setColour(colour); } /** @@ -153,7 +147,6 @@ export class CommentIcon extends Icon implements IHasBubble, ISerializable { super.onLocationChange(blockOrigin); const anchorLocation = this.getAnchorLocation(); this.textInputBubble?.setAnchorLocation(anchorLocation); - this.textBubble?.setAnchorLocation(anchorLocation); } /** Sets the text of this comment. Updates any bubbles if they are visible. */ @@ -170,7 +163,6 @@ export class CommentIcon extends Icon implements IHasBubble, ISerializable { ); this.text = text; this.textInputBubble?.setText(this.text); - this.textBubble?.setText(this.text); } /** Returns the text of this comment. */ @@ -302,6 +294,18 @@ export class CommentIcon extends Icon implements IHasBubble, ISerializable { * to update the state of this icon in response to changes in the bubble. */ private showEditableBubble() { + this.createBubble(); + this.textInputBubble?.addTextChangeListener(() => this.onTextChange()); + this.textInputBubble?.addSizeChangeListener(() => this.onSizeChange()); + } + + /** Shows the non editable text bubble for this comment. */ + private showNonEditableBubble() { + this.createBubble(); + this.textInputBubble?.setEditable(false); + } + + protected createBubble() { this.textInputBubble = new TextInputBubble( this.sourceBlock.workspace as WorkspaceSvg, this.getAnchorLocation(), @@ -309,26 +313,12 @@ export class CommentIcon extends Icon implements IHasBubble, ISerializable { ); this.textInputBubble.setText(this.getText()); this.textInputBubble.setSize(this.bubbleSize, true); - this.textInputBubble.addTextChangeListener(() => this.onTextChange()); - this.textInputBubble.addSizeChangeListener(() => this.onSizeChange()); - } - - /** Shows the non editable text bubble for this comment. */ - private showNonEditableBubble() { - this.textBubble = new TextBubble( - this.getText(), - this.sourceBlock.workspace as WorkspaceSvg, - this.getAnchorLocation(), - this.getBubbleOwnerRect(), - ); } /** Hides any open bubbles owned by this comment. */ private hideBubble() { this.textInputBubble?.dispose(); this.textInputBubble = null; - this.textBubble?.dispose(); - this.textBubble = null; } /** diff --git a/tests/mocha/comment_test.js b/tests/mocha/comment_test.js index 8024fa5e3..79b3d7de6 100644 --- a/tests/mocha/comment_test.js +++ b/tests/mocha/comment_test.js @@ -41,12 +41,12 @@ suite('Comments', function () { }); function assertEditable(comment) { - assert.isNotOk(comment.textBubble); assert.isOk(comment.textInputBubble); + assert.isTrue(comment.textInputBubble.isEditable()); } function assertNotEditable(comment) { - assert.isNotOk(comment.textInputBubble); - assert.isOk(comment.textBubble); + assert.isOk(comment.textInputBubble); + assert.isFalse(comment.textInputBubble.isEditable()); } test('Editable', async function () { await this.comment.setBubbleVisible(true); From 3c91b306d3bb84f7a27c0d16a2590a15d8d4bcc6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Nov 2024 11:54:14 -0800 Subject: [PATCH 72/90] chore(deps): bump eslint-plugin-jsdoc from 48.5.0 to 50.4.3 (#8641) Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 48.5.0 to 50.4.3. - [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases) - [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc) - [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v48.5.0...v50.4.3) --- updated-dependencies: - dependency-name: eslint-plugin-jsdoc dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 141 ++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 67 insertions(+), 76 deletions(-) diff --git a/package-lock.json b/package-lock.json index 19a37cfa0..a7385f285 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,7 @@ "eslint": "^8.4.1", "eslint-config-google": "^0.14.0", "eslint-config-prettier": "^9.0.0", - "eslint-plugin-jsdoc": "^48.0.2", + "eslint-plugin-jsdoc": "^50.4.3", "glob": "^10.3.4", "google-closure-compiler": "^20240317.0.0", "gulp": "^5.0.0", @@ -235,17 +235,14 @@ } }, "node_modules/@es-joy/jsdoccomment": { - "version": "0.43.1", - "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.43.1.tgz", - "integrity": "sha512-I238eDtOolvCuvtxrnqtlBaw0BwdQuYqK7eA6XIonicMdOOOb75mqdIzkGDUbS04+1Di007rgm9snFRNeVrOog==", + "version": "0.49.0", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.49.0.tgz", + "integrity": "sha512-xjZTSFgECpb9Ohuk5yMX5RhUEbfeQcuOp8IF60e+wyzWEF0M5xeSgqsfLtvPEX8BIyOX9saZqzuGPmZ8oWc+5Q==", "dev": true, "dependencies": { - "@types/eslint": "^8.56.5", - "@types/estree": "^1.0.5", - "@typescript-eslint/types": "^7.2.0", "comment-parser": "1.4.1", - "esquery": "^1.5.0", - "jsdoc-type-pratt-parser": "~4.0.0" + "esquery": "^1.6.0", + "jsdoc-type-pratt-parser": "~4.1.0" }, "engines": { "node": ">=16" @@ -1068,34 +1065,12 @@ "integrity": "sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==", "dev": true }, - "node_modules/@types/eslint": { - "version": "8.56.10", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", - "integrity": "sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==", - "dev": true, - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", - "dev": true - }, "node_modules/@types/expect": { "version": "1.20.4", "resolved": "https://registry.npmjs.org/@types/expect/-/expect-1.20.4.tgz", "integrity": "sha512-Q5Vn3yjTDyCMV50TB6VRIbQNxSE4OmZR86VSbGaNpfUolm0iePBB4KdEEHmxoY5sT2+2DIvXW0rvMDP2nHZ4Mg==", "dev": true }, - "node_modules/@types/json-schema": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true - }, "node_modules/@types/node": { "version": "20.16.3", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.3.tgz", @@ -1372,20 +1347,6 @@ } } }, - "node_modules/@typescript-eslint/types": { - "version": "7.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.16.1.tgz", - "integrity": "sha512-AQn9XqCzUXd4bAVEsAXM/Izk11Wx2u4H3BAfQVhSfzfDOm/wAON9nP7J5rpkCxts7E5TELmN845xTUCQrD1xIQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/@typescript-eslint/typescript-estree": { "version": "8.6.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.6.0.tgz", @@ -1678,9 +1639,9 @@ } }, "node_modules/acorn": { - "version": "8.11.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz", - "integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -3722,21 +3683,22 @@ } }, "node_modules/eslint-plugin-jsdoc": { - "version": "48.5.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.5.0.tgz", - "integrity": "sha512-ukXPNpGby3KjCveCizIS8t1EbuJEHYEu/tBg8GCbn/YbHcXwphyvYCdvRZ/oMRfTscGSSzfsWoZ+ZkAP0/6YMQ==", + "version": "50.4.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-50.4.3.tgz", + "integrity": "sha512-uWtwFxGRv6B8sU63HZM5dAGDhgsatb+LONwmILZJhdRALLOkCX2HFZhdL/Kw2ls8SQMAVEfK+LmnEfxInRN8HA==", "dev": true, "dependencies": { - "@es-joy/jsdoccomment": "~0.43.1", + "@es-joy/jsdoccomment": "~0.49.0", "are-docs-informative": "^0.0.2", "comment-parser": "1.4.1", - "debug": "^4.3.4", + "debug": "^4.3.6", "escape-string-regexp": "^4.0.0", - "esquery": "^1.5.0", - "parse-imports": "^2.1.0", - "semver": "^7.6.2", + "espree": "^10.1.0", + "esquery": "^1.6.0", + "parse-imports": "^2.1.1", + "semver": "^7.6.3", "spdx-expression-parse": "^4.0.0", - "synckit": "^0.9.0" + "synckit": "^0.9.1" }, "engines": { "node": ">=18" @@ -3745,10 +3707,39 @@ "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" } }, + "node_modules/eslint-plugin-jsdoc/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-plugin-jsdoc/node_modules/espree": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", + "dev": true, + "dependencies": { + "acorn": "^8.14.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/eslint-plugin-jsdoc/node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -3838,9 +3829,9 @@ } }, "node_modules/esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, "dependencies": { "estraverse": "^5.1.0" @@ -5822,9 +5813,9 @@ "dev": true }, "node_modules/jsdoc-type-pratt-parser": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz", - "integrity": "sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.1.0.tgz", + "integrity": "sha512-Hicd6JK5Njt2QB6XYFS7ok9e37O8AYk3jTcppG4YVQnYjOemymvTcmc7OWsmq/Qqj5TdRFO5/x/tIPmBeRtGHg==", "dev": true, "engines": { "node": ">=12.0.0" @@ -6858,9 +6849,9 @@ } }, "node_modules/parse-imports": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/parse-imports/-/parse-imports-2.1.0.tgz", - "integrity": "sha512-JQWgmK2o4w8leUkZeZPatWdAny6vXGU/3siIUvMF6J2rDCud9aTt8h/px9oZJ6U3EcfhngBJ635uPFI0q0VAeA==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/parse-imports/-/parse-imports-2.2.1.tgz", + "integrity": "sha512-OL/zLggRp8mFhKL0rNORUTR4yBYujK/uU+xZL+/0Rgm2QE4nLO9v8PzEweSJEbMGKmDRjJE4R3IMJlL2di4JeQ==", "dev": true, "dependencies": { "es-module-lexer": "^1.5.3", @@ -8209,9 +8200,9 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==" }, "node_modules/synckit": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.0.tgz", - "integrity": "sha512-7RnqIMq572L8PeEzKeBINYEJDDxpcH8JEgLwUqBd3TkofhFRbkq4QLR0u+36avGAhCRbk2nnmjcW9SE531hPDg==", + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.2.tgz", + "integrity": "sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==", "dev": true, "dependencies": { "@pkgr/core": "^0.1.0", @@ -8225,9 +8216,9 @@ } }, "node_modules/synckit/node_modules/tslib": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", - "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "dev": true }, "node_modules/tar-fs": { diff --git a/package.json b/package.json index 9fcdada41..10b5e2ab9 100644 --- a/package.json +++ b/package.json @@ -115,7 +115,7 @@ "eslint": "^8.4.1", "eslint-config-google": "^0.14.0", "eslint-config-prettier": "^9.0.0", - "eslint-plugin-jsdoc": "^48.0.2", + "eslint-plugin-jsdoc": "^50.4.3", "glob": "^10.3.4", "google-closure-compiler": "^20240317.0.0", "gulp": "^5.0.0", From f1cbaab6ef3f7767ff5fecd78509309841e06b42 Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Fri, 8 Nov 2024 14:21:16 -0800 Subject: [PATCH 73/90] refactor: Move functions into FieldDropdown. (#8634) * refactor: Move functions into FieldDropdown. * refactor: Make dropdown field image metrics static. * refactor: Use template literals in FieldDropdown validator. --- core/field_dropdown.ts | 281 ++++++++++++++++++++--------------------- 1 file changed, 134 insertions(+), 147 deletions(-) diff --git a/core/field_dropdown.ts b/core/field_dropdown.ts index 71b17326d..b1e3b5af2 100644 --- a/core/field_dropdown.ts +++ b/core/field_dropdown.ts @@ -95,6 +95,15 @@ export class FieldDropdown extends Field { private selectedOption!: MenuOption; override clickTarget_: SVGElement | null = null; + /** + * The y offset from the top of the field to the top of the image, if an image + * is selected. + */ + protected static IMAGE_Y_OFFSET = 5; + + /** The total vertical padding above and below an image. */ + protected static IMAGE_Y_PADDING = FieldDropdown.IMAGE_Y_OFFSET * 2; + /** * @param menuGenerator A non-empty array of options for a dropdown list, or a * function which generates these options. Also accepts Field.SKIP_SETUP @@ -128,8 +137,8 @@ export class FieldDropdown extends Field { if (menuGenerator === Field.SKIP_SETUP) return; if (Array.isArray(menuGenerator)) { - validateOptions(menuGenerator); - const trimmed = trimOptions(menuGenerator); + this.validateOptions(menuGenerator); + const trimmed = this.trimOptions(menuGenerator); this.menuGenerator_ = trimmed.options; this.prefixField = trimmed.prefix || null; this.suffixField = trimmed.suffix || null; @@ -401,7 +410,7 @@ export class FieldDropdown extends Field { if (useCache && this.generatedOptions) return this.generatedOptions; this.generatedOptions = this.menuGenerator_(); - validateOptions(this.generatedOptions); + this.validateOptions(this.generatedOptions); return this.generatedOptions; } @@ -520,7 +529,7 @@ export class FieldDropdown extends Field { const hasBorder = !!this.borderRect_; const height = Math.max( hasBorder ? this.getConstants()!.FIELD_DROPDOWN_BORDER_RECT_HEIGHT : 0, - imageHeight + IMAGE_Y_PADDING, + imageHeight + FieldDropdown.IMAGE_Y_PADDING, ); const xPadding = hasBorder ? this.getConstants()!.FIELD_BORDER_RECT_X_PADDING @@ -661,6 +670,127 @@ export class FieldDropdown extends Field { // override the static fromJson method. return new this(options.options, undefined, options); } + + /** + * Factor out common words in statically defined options. + * Create prefix and/or suffix labels. + */ + protected trimOptions(options: MenuOption[]): { + options: MenuOption[]; + prefix?: string; + suffix?: string; + } { + let hasImages = false; + const trimmedOptions = options.map(([label, value]): MenuOption => { + if (typeof label === 'string') { + return [parsing.replaceMessageReferences(label), value]; + } + + hasImages = true; + // Copy the image properties so they're not influenced by the original. + // NOTE: No need to deep copy since image properties are only 1 level deep. + const imageLabel = + label.alt !== null + ? {...label, alt: parsing.replaceMessageReferences(label.alt)} + : {...label}; + return [imageLabel, value]; + }); + + if (hasImages || options.length < 2) return {options: trimmedOptions}; + + const stringOptions = trimmedOptions as [string, string][]; + const stringLabels = stringOptions.map(([label]) => label); + + const shortest = utilsString.shortestStringLength(stringLabels); + const prefixLength = utilsString.commonWordPrefix(stringLabels, shortest); + const suffixLength = utilsString.commonWordSuffix(stringLabels, shortest); + + if ( + (!prefixLength && !suffixLength) || + shortest <= prefixLength + suffixLength + ) { + // One or more strings will entirely vanish if we proceed. Abort. + return {options: stringOptions}; + } + + const prefix = prefixLength + ? stringLabels[0].substring(0, prefixLength - 1) + : undefined; + const suffix = suffixLength + ? stringLabels[0].substr(1 - suffixLength) + : undefined; + return { + options: this.applyTrim(stringOptions, prefixLength, suffixLength), + prefix, + suffix, + }; + } + + /** + * Use the calculated prefix and suffix lengths to trim all of the options in + * the given array. + * + * @param options Array of option tuples: + * (human-readable text or image, language-neutral name). + * @param prefixLength The length of the common prefix. + * @param suffixLength The length of the common suffix + * @returns A new array with all of the option text trimmed. + */ + private applyTrim( + options: [string, string][], + prefixLength: number, + suffixLength: number, + ): MenuOption[] { + return options.map(([text, value]) => [ + text.substring(prefixLength, text.length - suffixLength), + value, + ]); + } + + /** + * Validates the data structure to be processed as an options list. + * + * @param options The proposed dropdown options. + * @throws {TypeError} If proposed options are incorrectly structured. + */ + protected validateOptions(options: MenuOption[]) { + if (!Array.isArray(options)) { + throw TypeError('FieldDropdown options must be an array.'); + } + if (!options.length) { + throw TypeError('FieldDropdown options must not be an empty array.'); + } + let foundError = false; + for (let i = 0; i < options.length; i++) { + const tuple = options[i]; + if (!Array.isArray(tuple)) { + foundError = true; + console.error( + `Invalid option[${i}]: Each FieldDropdown option must be an array. + Found: ${tuple}`, + ); + } else if (typeof tuple[1] !== 'string') { + foundError = true; + console.error( + `Invalid option[${i}]: Each FieldDropdown option id must be a string. + Found ${tuple[1]} in: ${tuple}`, + ); + } else if ( + tuple[0] && + typeof tuple[0] !== 'string' && + typeof tuple[0].src !== 'string' + ) { + foundError = true; + console.error( + `Invalid option[${i}]: Each FieldDropdown option must have a string + label or image description. Found ${tuple[0]} in: ${tuple}`, + ); + } + } + if (foundError) { + throw TypeError('Found invalid FieldDropdown options.'); + } + } } /** @@ -721,147 +851,4 @@ export interface FieldDropdownFromJsonConfig extends FieldDropdownConfig { */ export type FieldDropdownValidator = FieldValidator; -/** - * The y offset from the top of the field to the top of the image, if an image - * is selected. - */ -const IMAGE_Y_OFFSET = 5; - -/** The total vertical padding above and below an image. */ -const IMAGE_Y_PADDING: number = IMAGE_Y_OFFSET * 2; - -/** - * Factor out common words in statically defined options. - * Create prefix and/or suffix labels. - */ -function trimOptions(options: MenuOption[]): { - options: MenuOption[]; - prefix?: string; - suffix?: string; -} { - let hasImages = false; - const trimmedOptions = options.map(([label, value]): MenuOption => { - if (typeof label === 'string') { - return [parsing.replaceMessageReferences(label), value]; - } - - hasImages = true; - // Copy the image properties so they're not influenced by the original. - // NOTE: No need to deep copy since image properties are only 1 level deep. - const imageLabel = - label.alt !== null - ? {...label, alt: parsing.replaceMessageReferences(label.alt)} - : {...label}; - return [imageLabel, value]; - }); - - if (hasImages || options.length < 2) return {options: trimmedOptions}; - - const stringOptions = trimmedOptions as [string, string][]; - const stringLabels = stringOptions.map(([label]) => label); - - const shortest = utilsString.shortestStringLength(stringLabels); - const prefixLength = utilsString.commonWordPrefix(stringLabels, shortest); - const suffixLength = utilsString.commonWordSuffix(stringLabels, shortest); - - if ( - (!prefixLength && !suffixLength) || - shortest <= prefixLength + suffixLength - ) { - // One or more strings will entirely vanish if we proceed. Abort. - return {options: stringOptions}; - } - - const prefix = prefixLength - ? stringLabels[0].substring(0, prefixLength - 1) - : undefined; - const suffix = suffixLength - ? stringLabels[0].substr(1 - suffixLength) - : undefined; - return { - options: applyTrim(stringOptions, prefixLength, suffixLength), - prefix, - suffix, - }; -} - -/** - * Use the calculated prefix and suffix lengths to trim all of the options in - * the given array. - * - * @param options Array of option tuples: - * (human-readable text or image, language-neutral name). - * @param prefixLength The length of the common prefix. - * @param suffixLength The length of the common suffix - * @returns A new array with all of the option text trimmed. - */ -function applyTrim( - options: [string, string][], - prefixLength: number, - suffixLength: number, -): MenuOption[] { - return options.map(([text, value]) => [ - text.substring(prefixLength, text.length - suffixLength), - value, - ]); -} - -/** - * Validates the data structure to be processed as an options list. - * - * @param options The proposed dropdown options. - * @throws {TypeError} If proposed options are incorrectly structured. - */ -function validateOptions(options: MenuOption[]) { - if (!Array.isArray(options)) { - throw TypeError('FieldDropdown options must be an array.'); - } - if (!options.length) { - throw TypeError('FieldDropdown options must not be an empty array.'); - } - let foundError = false; - for (let i = 0; i < options.length; i++) { - const tuple = options[i]; - if (!Array.isArray(tuple)) { - foundError = true; - console.error( - 'Invalid option[' + - i + - ']: Each FieldDropdown option must be an ' + - 'array. Found: ', - tuple, - ); - } else if (typeof tuple[1] !== 'string') { - foundError = true; - console.error( - 'Invalid option[' + - i + - ']: Each FieldDropdown option id must be ' + - 'a string. Found ' + - tuple[1] + - ' in: ', - tuple, - ); - } else if ( - tuple[0] && - typeof tuple[0] !== 'string' && - typeof tuple[0].src !== 'string' - ) { - foundError = true; - console.error( - 'Invalid option[' + - i + - ']: Each FieldDropdown option must have a ' + - 'string label or image description. Found' + - tuple[0] + - ' in: ', - tuple, - ); - } - } - if (foundError) { - throw TypeError('Found invalid FieldDropdown options.'); - } -} - fieldRegistry.register('field_dropdown', FieldDropdown); From 378d5a97d9034c88cd510f9752d72d016d2cd2c1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2024 07:53:36 -0800 Subject: [PATCH 74/90] chore(deps): bump chai from 5.1.1 to 5.1.2 (#8651) Bumps [chai](https://github.com/chaijs/chai) from 5.1.1 to 5.1.2. - [Release notes](https://github.com/chaijs/chai/releases) - [Changelog](https://github.com/chaijs/chai/blob/main/History.md) - [Commits](https://github.com/chaijs/chai/compare/v5.1.1...v5.1.2) --- updated-dependencies: - dependency-name: chai dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index a7385f285..626befab0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2414,9 +2414,9 @@ } }, "node_modules/chai": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.1.tgz", - "integrity": "sha512-pT1ZgP8rPNqUgieVaEY+ryQr6Q4HXNg8Ei9UnLUrjN4IA7dvQC5JB+/kxVcPNDHyBcc/26CXPkbNzq3qwrOEKA==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.2.tgz", + "integrity": "sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==", "dev": true, "dependencies": { "assertion-error": "^2.0.1", From 9a7de53029afc09dfc9d055a4eae40b316728455 Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Mon, 11 Nov 2024 08:51:16 -0800 Subject: [PATCH 75/90] fix: Fix crash when resizing page while editing a field. (#8646) * fix: Fix crash when resizing page while editing a field. * refactor: Clean up positioning and exceptions. --- core/field_input.ts | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/core/field_input.ts b/core/field_input.ts index 7ef5a01bc..722316f4f 100644 --- a/core/field_input.ts +++ b/core/field_input.ts @@ -28,8 +28,8 @@ import { UnattachedFieldError, } from './field.js'; import {Msg} from './msg.js'; +import * as renderManagement from './render_management.js'; import * as aria from './utils/aria.js'; -import {Coordinate} from './utils/coordinate.js'; import * as dom from './utils/dom.js'; import {Size} from './utils/size.js'; import * as userAgent from './utils/useragent.js'; @@ -630,22 +630,22 @@ export abstract class FieldInput extends Field< /** Resize the editor to fit the text. */ protected resizeEditor_() { - const block = this.getSourceBlock(); - if (!block) { - throw new UnattachedFieldError(); - } - const div = WidgetDiv.getDiv(); - const bBox = this.getScaledBBox(); - div!.style.width = bBox.right - bBox.left + 'px'; - div!.style.height = bBox.bottom - bBox.top + 'px'; + renderManagement.finishQueuedRenders().then(() => { + const block = this.getSourceBlock(); + if (!block) throw new UnattachedFieldError(); + const div = WidgetDiv.getDiv(); + const bBox = this.getScaledBBox(); + div!.style.width = bBox.right - bBox.left + 'px'; + div!.style.height = bBox.bottom - bBox.top + 'px'; - // In RTL mode block fields and LTR input fields the left edge moves, - // whereas the right edge is fixed. Reposition the editor. - const x = block.RTL ? bBox.right - div!.offsetWidth : bBox.left; - const xy = new Coordinate(x, bBox.top); + // In RTL mode block fields and LTR input fields the left edge moves, + // whereas the right edge is fixed. Reposition the editor. + const x = block.RTL ? bBox.right - div!.offsetWidth : bBox.left; + const y = bBox.top; - div!.style.left = xy.x + 'px'; - div!.style.top = xy.y + 'px'; + div!.style.left = `${x}px`; + div!.style.top = `${y}px`; + }); } /** @@ -657,7 +657,7 @@ export abstract class FieldInput extends Field< * div. */ override repositionForWindowResize(): boolean { - const block = this.getSourceBlock(); + const block = this.getSourceBlock()?.getRootBlock(); // This shouldn't be possible. We should never have a WidgetDiv if not using // rendered blocks. if (!(block instanceof BlockSvg)) return false; From 22c879f305665ffbec28c33b253ed725cbcdc70c Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Mon, 11 Nov 2024 10:49:04 -0800 Subject: [PATCH 76/90] release: Update version number to 11.2.0-beta.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 852905353..b92c90d5c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "blockly", - "version": "11.2.0-beta.0", + "version": "11.2.0-beta.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "blockly", - "version": "11.2.0-beta.0", + "version": "11.2.0-beta.1", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index 70b70380c..a1934d2da 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "blockly", - "version": "11.2.0-beta.0", + "version": "11.2.0-beta.1", "description": "Blockly is a library for building visual programming editors.", "keywords": [ "blockly" From 34b0b523e11cb6e9ebf9e39a9536eade5c6863d4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 10:49:34 -0800 Subject: [PATCH 77/90] chore(deps): bump @typescript-eslint/eslint-plugin from 8.6.0 to 8.14.0 (#8662) Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 8.6.0 to 8.14.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.14.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 129 ++++++++++++++++------------------------------ 1 file changed, 45 insertions(+), 84 deletions(-) diff --git a/package-lock.json b/package-lock.json index 626befab0..676720505 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1122,16 +1122,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.6.0.tgz", - "integrity": "sha512-UOaz/wFowmoh2G6Mr9gw60B1mm0MzUtm6Ic8G2yM1Le6gyj5Loi/N+O5mocugRGY+8OeeKmkMmbxNqUCq3B4Sg==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.14.0.tgz", + "integrity": "sha512-tqp8H7UWFaZj0yNO6bycd5YjMwxa6wIHOLZvWPkidwbgLCsBMetQoGj7DPuAlWa2yGO3H48xmPwjhsSPPCGU5w==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.6.0", - "@typescript-eslint/type-utils": "8.6.0", - "@typescript-eslint/utils": "8.6.0", - "@typescript-eslint/visitor-keys": "8.6.0", + "@typescript-eslint/scope-manager": "8.14.0", + "@typescript-eslint/type-utils": "8.14.0", + "@typescript-eslint/utils": "8.14.0", + "@typescript-eslint/visitor-keys": "8.14.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -1294,13 +1294,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.6.0.tgz", - "integrity": "sha512-ZuoutoS5y9UOxKvpc/GkvF4cuEmpokda4wRg64JEia27wX+PysIE9q+lzDtlHHgblwUWwo5/Qn+/WyTUvDwBHw==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.14.0.tgz", + "integrity": "sha512-aBbBrnW9ARIDn92Zbo7rguLnqQ/pOrUguVpbUwzOhkFg2npFDwTgPGqFqE0H5feXcOoJOfX3SxlJaKEVtq54dw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.6.0", - "@typescript-eslint/visitor-keys": "8.6.0" + "@typescript-eslint/types": "8.14.0", + "@typescript-eslint/visitor-keys": "8.14.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1310,27 +1310,14 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/scope-manager/node_modules/@typescript-eslint/types": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.6.0.tgz", - "integrity": "sha512-rojqFZGd4MQxw33SrOy09qIDS8WEldM8JWtKQLAjf/X5mGSeEFh5ixQlxssMNyPslVIk9yzWqXCsV2eFhYrYUw==", - "dev": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.6.0.tgz", - "integrity": "sha512-dtePl4gsuenXVwC7dVNlb4mGDcKjDT/Ropsk4za/ouMBPplCLyznIaR+W65mvCvsyS97dymoBRrioEXI7k0XIg==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.14.0.tgz", + "integrity": "sha512-Xcz9qOtZuGusVOH5Uk07NGs39wrKkf3AxlkK79RBK6aJC1l03CobXjJbwBPSidetAOV+5rEVuiT1VSBUOAsanQ==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "8.6.0", - "@typescript-eslint/utils": "8.6.0", + "@typescript-eslint/typescript-estree": "8.14.0", + "@typescript-eslint/utils": "8.14.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -1347,14 +1334,27 @@ } } }, + "node_modules/@typescript-eslint/types": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.14.0.tgz", + "integrity": "sha512-yjeB9fnO/opvLJFAsPNYlKPnEM8+z4og09Pk504dkqonT02AyL5Z9SSqlE0XqezS93v6CXn49VHvB2G7XSsl0g==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.6.0.tgz", - "integrity": "sha512-MOVAzsKJIPIlLK239l5s06YXjNqpKTVhBVDnqUumQJja5+Y94V3+4VUFRA0G60y2jNnTVwRCkhyGQpavfsbq/g==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.14.0.tgz", + "integrity": "sha512-OPXPLYKGZi9XS/49rdaCbR5j/S14HazviBlUQFvSKz3npr3NikF+mrgK7CFVur6XEt95DZp/cmke9d5i3vtVnQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.6.0", - "@typescript-eslint/visitor-keys": "8.6.0", + "@typescript-eslint/types": "8.14.0", + "@typescript-eslint/visitor-keys": "8.14.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -1375,19 +1375,6 @@ } } }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/types": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.6.0.tgz", - "integrity": "sha512-rojqFZGd4MQxw33SrOy09qIDS8WEldM8JWtKQLAjf/X5mGSeEFh5ixQlxssMNyPslVIk9yzWqXCsV2eFhYrYUw==", - "dev": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -1425,15 +1412,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.6.0.tgz", - "integrity": "sha512-eNp9cWnYf36NaOVjkEUznf6fEgVy1TWpE0o52e4wtojjBx7D1UV2WAWGzR+8Y5lVFtpMLPwNbC67T83DWSph4A==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.14.0.tgz", + "integrity": "sha512-OGqj6uB8THhrHj0Fk27DcHPojW7zKwKkPmHXHvQ58pLYp4hy8CSUdTKykKeh+5vFqTTVmjz0zCOOPKRovdsgHA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.6.0", - "@typescript-eslint/types": "8.6.0", - "@typescript-eslint/typescript-estree": "8.6.0" + "@typescript-eslint/scope-manager": "8.14.0", + "@typescript-eslint/types": "8.14.0", + "@typescript-eslint/typescript-estree": "8.14.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1446,26 +1433,13 @@ "eslint": "^8.57.0 || ^9.0.0" } }, - "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/types": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.6.0.tgz", - "integrity": "sha512-rojqFZGd4MQxw33SrOy09qIDS8WEldM8JWtKQLAjf/X5mGSeEFh5ixQlxssMNyPslVIk9yzWqXCsV2eFhYrYUw==", - "dev": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.6.0.tgz", - "integrity": "sha512-wapVFfZg9H0qOYh4grNVQiMklJGluQrOUiOhYRrQWhx7BY/+I1IYb8BczWNbbUpO+pqy0rDciv3lQH5E1bCLrg==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.14.0.tgz", + "integrity": "sha512-vG0XZo8AdTH9OE6VFRwAZldNc7qtJ/6NLGWak+BtENuEUXGZgFpihILPiBvKXvJ2nFu27XNGC6rKiwuaoMbYzQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.6.0", + "@typescript-eslint/types": "8.14.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { @@ -1476,19 +1450,6 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/visitor-keys/node_modules/@typescript-eslint/types": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.6.0.tgz", - "integrity": "sha512-rojqFZGd4MQxw33SrOy09qIDS8WEldM8JWtKQLAjf/X5mGSeEFh5ixQlxssMNyPslVIk9yzWqXCsV2eFhYrYUw==", - "dev": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/@ungap/structured-clone": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", From b73d6156a52a78c8fbfcb10b99a7160104be2e7c Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Thu, 21 Nov 2024 11:28:27 -0800 Subject: [PATCH 78/90] fix: Fix bug that caused comments to be incorrectly positioned. (#8668) --- core/icons/comment_icon.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/icons/comment_icon.ts b/core/icons/comment_icon.ts index 8cdf77918..ea120ca17 100644 --- a/core/icons/comment_icon.ts +++ b/core/icons/comment_icon.ts @@ -338,8 +338,7 @@ export class CommentIcon extends Icon implements IHasBubble, ISerializable { * I.E. the block that owns this icon. */ private getBubbleOwnerRect(): Rect { - const bbox = (this.sourceBlock as BlockSvg).getSvgRoot().getBBox(); - return new Rect(bbox.y, bbox.y + bbox.height, bbox.x, bbox.x + bbox.width); + return (this.sourceBlock as BlockSvg).getBoundingRectangleWithoutChildren(); } } From 6f3f884345c9874fd3cd52eb2816d86902554ef6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 09:52:09 -0800 Subject: [PATCH 79/90] chore(deps): bump @typescript-eslint/parser from 8.11.0 to 8.15.0 (#8673) Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 8.11.0 to 8.15.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.15.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 62 ++++++++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/package-lock.json b/package-lock.json index 676720505..971bc80c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1155,15 +1155,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.11.0.tgz", - "integrity": "sha512-lmt73NeHdy1Q/2ul295Qy3uninSqi6wQI18XwSpm8w0ZbQXUpjCAWP1Vlv/obudoBiIjJVjlztjQ+d/Md98Yxg==", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.15.0.tgz", + "integrity": "sha512-7n59qFpghG4uazrF9qtGKBZXn7Oz4sOMm8dwNWDQY96Xlm2oX67eipqcblDj+oY1lLCbf1oltMZFpUso66Kl1A==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "8.11.0", - "@typescript-eslint/types": "8.11.0", - "@typescript-eslint/typescript-estree": "8.11.0", - "@typescript-eslint/visitor-keys": "8.11.0", + "@typescript-eslint/scope-manager": "8.15.0", + "@typescript-eslint/types": "8.15.0", + "@typescript-eslint/typescript-estree": "8.15.0", + "@typescript-eslint/visitor-keys": "8.15.0", "debug": "^4.3.4" }, "engines": { @@ -1183,13 +1183,13 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.11.0.tgz", - "integrity": "sha512-Uholz7tWhXmA4r6epo+vaeV7yjdKy5QFCERMjs1kMVsLRKIrSdM6o21W2He9ftp5PP6aWOVpD5zvrvuHZC0bMQ==", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.15.0.tgz", + "integrity": "sha512-QRGy8ADi4J7ii95xz4UoiymmmMd/zuy9azCaamnZ3FM8T5fZcex8UfJcjkiEZjJSztKfEBe3dZ5T/5RHAmw2mA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.11.0", - "@typescript-eslint/visitor-keys": "8.11.0" + "@typescript-eslint/types": "8.15.0", + "@typescript-eslint/visitor-keys": "8.15.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1200,9 +1200,9 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.11.0.tgz", - "integrity": "sha512-tn6sNMHf6EBAYMvmPUaKaVeYvhUsrE6x+bXQTxjQRp360h1giATU0WvgeEys1spbvb5R+VpNOZ+XJmjD8wOUHw==", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.15.0.tgz", + "integrity": "sha512-n3Gt8Y/KyJNe0S3yDCD2RVKrHBC4gTUcLTebVBXacPy091E6tNspFLKRXlk3hwT4G55nfr1n2AdFqi/XMxzmPQ==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1213,13 +1213,13 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.11.0.tgz", - "integrity": "sha512-yHC3s1z1RCHoCz5t06gf7jH24rr3vns08XXhfEqzYpd6Hll3z/3g23JRi0jM8A47UFKNc3u/y5KIMx8Ynbjohg==", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.15.0.tgz", + "integrity": "sha512-1eMp2JgNec/niZsR7ioFBlsh/Fk0oJbhaqO0jRyQBMgkz7RrFfkqF9lYYmBoGBaSiLnu8TAPQTwoTUiSTUW9dg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.11.0", - "@typescript-eslint/visitor-keys": "8.11.0", + "@typescript-eslint/types": "8.15.0", + "@typescript-eslint/visitor-keys": "8.15.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -1241,13 +1241,13 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.11.0.tgz", - "integrity": "sha512-EaewX6lxSjRJnc+99+dqzTeoDZUfyrA52d2/HRrkI830kgovWsmIiTfmr0NZorzqic7ga+1bS60lRBUgR3n/Bw==", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.15.0.tgz", + "integrity": "sha512-h8vYOulWec9LhpwfAdZf2bjr8xIp0KNKnpgqSz0qqYYKAW/QZKw3ktRndbiAtUz4acH4QLQavwZBYCc0wulA/Q==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.11.0", - "eslint-visitor-keys": "^3.4.3" + "@typescript-eslint/types": "8.15.0", + "eslint-visitor-keys": "^4.2.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1266,6 +1266,18 @@ "balanced-match": "^1.0.0" } }, + "node_modules/@typescript-eslint/parser/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/@typescript-eslint/parser/node_modules/minimatch": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", From 61bbd7dbf6de1306986389a72f7a14fd7641b9ba Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Mon, 2 Dec 2024 11:33:05 -0800 Subject: [PATCH 80/90] chore: Remove underscores from private fields. (#8682) * chore: Remove underscores from private fields. * refactor: Use public APIs in tests where possible. --- core/block.ts | 126 +++++++++--------- core/block_svg.ts | 40 ++---- core/component_manager.ts | 6 +- core/contextmenu_registry.ts | 16 +-- core/events/events_block_move.ts | 6 +- core/field.ts | 36 ++--- core/field_checkbox.ts | 6 +- core/field_input.ts | 32 ++--- core/flyout_base.ts | 8 +- core/flyout_metrics_manager.ts | 4 +- core/gesture.ts | 6 +- core/marker_manager.ts | 40 +++--- core/options.ts | 16 +-- core/scrollbar_pair.ts | 44 +++--- core/shortcut_registry.ts | 8 +- core/theme_manager.ts | 12 +- core/toolbox/category.ts | 12 +- core/toolbox/collapsible_category.ts | 4 +- core/toolbox/separator.ts | 8 +- core/toolbox/toolbox.ts | 58 ++++---- core/variable_map.ts | 15 +-- core/variable_model.ts | 6 +- core/workspace.ts | 8 +- core/workspace_audio.ts | 8 +- core/workspace_dragger.ts | 14 +- core/workspace_svg.ts | 64 ++++----- tests/mocha/block_json_test.js | 34 ++--- tests/mocha/block_test.js | 8 +- tests/mocha/blocks/logic_ternary_test.js | 2 +- tests/mocha/blocks/procedures_test.js | 16 +-- tests/mocha/event_test.js | 8 +- tests/mocha/field_number_test.js | 2 +- tests/mocha/field_test.js | 10 +- tests/mocha/field_textinput_test.js | 2 +- tests/mocha/keydown_test.js | 2 +- tests/mocha/shortcut_registry_test.js | 8 +- .../mocha/test_helpers/toolbox_definitions.js | 2 +- tests/mocha/toolbox_test.js | 72 +++++----- tests/mocha/variable_model_test.js | 8 +- tests/mocha/workspace_svg_test.js | 2 +- 40 files changed, 378 insertions(+), 401 deletions(-) diff --git a/core/block.ts b/core/block.ts index 189f67781..0face8f8c 100644 --- a/core/block.ts +++ b/core/block.ts @@ -89,7 +89,7 @@ export class Block implements IASTNodeLocation { * Colour of the block as HSV hue value (0-360) * This may be null if the block colour was not set via a hue number. */ - private hue_: number | null = null; + private hue: number | null = null; /** Colour of the block in '#RRGGBB' format. */ protected colour_ = '#000000'; @@ -184,13 +184,13 @@ export class Block implements IASTNodeLocation { protected childBlocks_: this[] = []; - private deletable_ = true; + private deletable = true; - private movable_ = true; + private movable = true; - private editable_ = true; + private editable = true; - private isShadow_ = false; + private shadow = false; protected collapsed_ = false; protected outputShape_: number | null = null; @@ -207,7 +207,7 @@ export class Block implements IASTNodeLocation { */ initialized = false; - private readonly xy_: Coordinate; + private readonly xy: Coordinate; isInFlyout: boolean; isInMutator: boolean; RTL: boolean; @@ -227,7 +227,7 @@ export class Block implements IASTNodeLocation { helpUrl: string | (() => string) | null = null; /** A bound callback function to use when the parent workspace changes. */ - private onchangeWrapper_: ((p1: Abstract) => void) | null = null; + private onchangeWrapper: ((p1: Abstract) => void) | null = null; /** * A count of statement inputs on the block. @@ -260,7 +260,7 @@ export class Block implements IASTNodeLocation { * The block's position in workspace units. (0, 0) is at the workspace's * origin; scale does not change this value. */ - this.xy_ = new Coordinate(0, 0); + this.xy = new Coordinate(0, 0); this.isInFlyout = workspace.isFlyout; this.isInMutator = workspace.isMutator; @@ -333,8 +333,8 @@ export class Block implements IASTNodeLocation { // Dispose of this change listener before unplugging. // Technically not necessary due to the event firing delay. // But future-proofing. - if (this.onchangeWrapper_) { - this.workspace.removeChangeListener(this.onchangeWrapper_); + if (this.onchangeWrapper) { + this.workspace.removeChangeListener(this.onchangeWrapper); } this.unplug(healStack); @@ -352,8 +352,8 @@ export class Block implements IASTNodeLocation { */ protected disposeInternal() { this.disposing = true; - if (this.onchangeWrapper_) { - this.workspace.removeChangeListener(this.onchangeWrapper_); + if (this.onchangeWrapper) { + this.workspace.removeChangeListener(this.onchangeWrapper); } this.workspace.removeTypedBlock(this); @@ -403,10 +403,10 @@ export class Block implements IASTNodeLocation { */ unplug(opt_healStack?: boolean) { if (this.outputConnection) { - this.unplugFromRow_(opt_healStack); + this.unplugFromRow(opt_healStack); } if (this.previousConnection) { - this.unplugFromStack_(opt_healStack); + this.unplugFromStack(opt_healStack); } } @@ -417,7 +417,7 @@ export class Block implements IASTNodeLocation { * @param opt_healStack Disconnect right-side block and connect to left-side * block. Defaults to false. */ - private unplugFromRow_(opt_healStack?: boolean) { + private unplugFromRow(opt_healStack?: boolean) { let parentConnection = null; if (this.outputConnection?.isConnected()) { parentConnection = this.outputConnection.targetConnection; @@ -430,7 +430,7 @@ export class Block implements IASTNodeLocation { return; } - const thisConnection = this.getOnlyValueConnection_(); + const thisConnection = this.getOnlyValueConnection(); if ( !thisConnection || !thisConnection.isConnected() || @@ -467,7 +467,7 @@ export class Block implements IASTNodeLocation { * * @returns The connection on the value input, or null. */ - private getOnlyValueConnection_(): Connection | null { + private getOnlyValueConnection(): Connection | null { let connection = null; for (let i = 0; i < this.inputList.length; i++) { const thisConnection = this.inputList[i].connection; @@ -492,7 +492,7 @@ export class Block implements IASTNodeLocation { * @param opt_healStack Disconnect child statement and reconnect stack. * Defaults to false. */ - private unplugFromStack_(opt_healStack?: boolean) { + private unplugFromStack(opt_healStack?: boolean) { let previousTarget = null; if (this.previousConnection?.isConnected()) { // Remember the connection that any next statements need to connect to. @@ -789,8 +789,8 @@ export class Block implements IASTNodeLocation { */ isDeletable(): boolean { return ( - this.deletable_ && - !this.isShadow_ && + this.deletable && + !this.shadow && !this.isDeadOrDying() && !this.workspace.options.readOnly ); @@ -802,7 +802,7 @@ export class Block implements IASTNodeLocation { * @returns True if the block's deletable property is true, false otherwise. */ isOwnDeletable(): boolean { - return this.deletable_; + return this.deletable; } /** @@ -811,7 +811,7 @@ export class Block implements IASTNodeLocation { * @param deletable True if deletable. */ setDeletable(deletable: boolean) { - this.deletable_ = deletable; + this.deletable = deletable; } /** @@ -822,8 +822,8 @@ export class Block implements IASTNodeLocation { */ isMovable(): boolean { return ( - this.movable_ && - !this.isShadow_ && + this.movable && + !this.shadow && !this.isDeadOrDying() && !this.workspace.options.readOnly ); @@ -836,7 +836,7 @@ export class Block implements IASTNodeLocation { * @internal */ isOwnMovable(): boolean { - return this.movable_; + return this.movable; } /** @@ -845,7 +845,7 @@ export class Block implements IASTNodeLocation { * @param movable True if movable. */ setMovable(movable: boolean) { - this.movable_ = movable; + this.movable = movable; } /** @@ -871,7 +871,7 @@ export class Block implements IASTNodeLocation { * @returns True if a shadow. */ isShadow(): boolean { - return this.isShadow_; + return this.shadow; } /** @@ -883,7 +883,7 @@ export class Block implements IASTNodeLocation { * @internal */ setShadow(shadow: boolean) { - this.isShadow_ = shadow; + this.shadow = shadow; } /** @@ -914,9 +914,7 @@ export class Block implements IASTNodeLocation { */ isEditable(): boolean { return ( - this.editable_ && - !this.isDeadOrDying() && - !this.workspace.options.readOnly + this.editable && !this.isDeadOrDying() && !this.workspace.options.readOnly ); } @@ -926,7 +924,7 @@ export class Block implements IASTNodeLocation { * @returns True if the block's editable property is true, false otherwise. */ isOwnEditable(): boolean { - return this.editable_; + return this.editable; } /** @@ -935,7 +933,7 @@ export class Block implements IASTNodeLocation { * @param editable True if editable. */ setEditable(editable: boolean) { - this.editable_ = editable; + this.editable = editable; for (let i = 0, input; (input = this.inputList[i]); i++) { for (let j = 0, field; (field = input.fieldRow[j]); j++) { field.updateEditable(); @@ -1046,7 +1044,7 @@ export class Block implements IASTNodeLocation { * @returns Hue value (0-360). */ getHue(): number | null { - return this.hue_; + return this.hue; } /** @@ -1057,7 +1055,7 @@ export class Block implements IASTNodeLocation { */ setColour(colour: number | string) { const parsed = parsing.parseBlockColour(colour); - this.hue_ = parsed.hue; + this.hue = parsed.hue; this.colour_ = parsed.hex; } @@ -1083,12 +1081,12 @@ export class Block implements IASTNodeLocation { if (onchangeFn && typeof onchangeFn !== 'function') { throw Error('onchange must be a function.'); } - if (this.onchangeWrapper_) { - this.workspace.removeChangeListener(this.onchangeWrapper_); + if (this.onchangeWrapper) { + this.workspace.removeChangeListener(this.onchangeWrapper); } this.onchange = onchangeFn; - this.onchangeWrapper_ = onchangeFn.bind(this); - this.workspace.addChangeListener(this.onchangeWrapper_); + this.onchangeWrapper = onchangeFn.bind(this); + this.workspace.addChangeListener(this.onchangeWrapper); } /** @@ -1774,15 +1772,15 @@ export class Block implements IASTNodeLocation { if (json['style'] && json['colour']) { throw Error(warningPrefix + 'Must not have both a colour and a style.'); } else if (json['style']) { - this.jsonInitStyle_(json, warningPrefix); + this.jsonInitStyle(json, warningPrefix); } else { - this.jsonInitColour_(json, warningPrefix); + this.jsonInitColour(json, warningPrefix); } // Interpolate the message blocks. let i = 0; while (json['message' + i] !== undefined) { - this.interpolate_( + this.interpolate( json['message' + i], json['args' + i] || [], // Backwards compatibility: lastDummyAlign aliases implicitAlign. @@ -1857,7 +1855,7 @@ export class Block implements IASTNodeLocation { * @param json Structured data describing the block. * @param warningPrefix Warning prefix string identifying block. */ - private jsonInitColour_(json: AnyDuringMigration, warningPrefix: string) { + private jsonInitColour(json: AnyDuringMigration, warningPrefix: string) { if ('colour' in json) { if (json['colour'] === undefined) { console.warn(warningPrefix + 'Undefined colour value.'); @@ -1878,7 +1876,7 @@ export class Block implements IASTNodeLocation { * @param json Structured data describing the block. * @param warningPrefix Warning prefix string identifying block. */ - private jsonInitStyle_(json: AnyDuringMigration, warningPrefix: string) { + private jsonInitStyle(json: AnyDuringMigration, warningPrefix: string) { const blockStyleName = json['style']; try { this.setStyle(blockStyleName); @@ -1930,21 +1928,21 @@ export class Block implements IASTNodeLocation { * of newline tokens, how should it be aligned? * @param warningPrefix Warning prefix string identifying block. */ - private interpolate_( + private interpolate( message: string, args: AnyDuringMigration[], implicitAlign: string | undefined, warningPrefix: string, ) { const tokens = parsing.tokenizeInterpolation(message); - this.validateTokens_(tokens, args.length); - const elements = this.interpolateArguments_(tokens, args, implicitAlign); + this.validateTokens(tokens, args.length); + const elements = this.interpolateArguments(tokens, args, implicitAlign); // An array of [field, fieldName] tuples. const fieldStack = []; for (let i = 0, element; (element = elements[i]); i++) { - if (this.isInputKeyword_(element['type'])) { - const input = this.inputFromJson_(element, warningPrefix); + if (this.isInputKeyword(element['type'])) { + const input = this.inputFromJson(element, warningPrefix); // Should never be null, but just in case. if (input) { for (let j = 0, tuple; (tuple = fieldStack[j]); j++) { @@ -1955,7 +1953,7 @@ export class Block implements IASTNodeLocation { } else { // All other types, including ones starting with 'input_' get routed // here. - const field = this.fieldFromJson_(element); + const field = this.fieldFromJson(element); if (field) { fieldStack.push([field, element['name']]); } @@ -1971,7 +1969,7 @@ export class Block implements IASTNodeLocation { * @param tokens An array of tokens to validate * @param argsCount The number of args that need to be referred to. */ - private validateTokens_(tokens: Array, argsCount: number) { + private validateTokens(tokens: Array, argsCount: number) { const visitedArgsHash = []; let visitedArgsCount = 0; for (let i = 0; i < tokens.length; i++) { @@ -2026,7 +2024,7 @@ export class Block implements IASTNodeLocation { * or dummy inputs, if necessary. * @returns The JSON definitions of field and inputs to add to the block. */ - private interpolateArguments_( + private interpolateArguments( tokens: Array, args: Array, implicitAlign: string | undefined, @@ -2049,7 +2047,7 @@ export class Block implements IASTNodeLocation { } else { // AnyDuringMigration because: Type '{ text: string; type: string; } // | null' is not assignable to type 'string | number'. - element = this.stringToFieldJson_(element) as AnyDuringMigration; + element = this.stringToFieldJson(element) as AnyDuringMigration; if (!element) { continue; } @@ -2061,9 +2059,7 @@ export class Block implements IASTNodeLocation { const length = elements.length; if ( length && - !this.isInputKeyword_( - (elements as AnyDuringMigration)[length - 1]['type'], - ) + !this.isInputKeyword((elements as AnyDuringMigration)[length - 1]['type']) ) { const dummyInput = {'type': 'input_dummy'}; if (implicitAlign) { @@ -2083,7 +2079,7 @@ export class Block implements IASTNodeLocation { * @param element The element to try to turn into a field. * @returns The field defined by the JSON, or null if one couldn't be created. */ - private fieldFromJson_(element: { + private fieldFromJson(element: { alt?: string; type: string; text?: string; @@ -2091,10 +2087,10 @@ export class Block implements IASTNodeLocation { const field = fieldRegistry.fromJson(element); if (!field && element['alt']) { if (typeof element['alt'] === 'string') { - const json = this.stringToFieldJson_(element['alt']); - return json ? this.fieldFromJson_(json) : null; + const json = this.stringToFieldJson(element['alt']); + return json ? this.fieldFromJson(json) : null; } - return this.fieldFromJson_(element['alt']); + return this.fieldFromJson(element['alt']); } return field; } @@ -2109,7 +2105,7 @@ export class Block implements IASTNodeLocation { * @returns The input that has been created, or null if one could not be * created for some reason (should never happen). */ - private inputFromJson_( + private inputFromJson( element: AnyDuringMigration, warningPrefix: string, ): Input | null { @@ -2167,7 +2163,7 @@ export class Block implements IASTNodeLocation { * @returns True if the given string matches one of the input keywords, false * otherwise. */ - private isInputKeyword_(str: string): boolean { + private isInputKeyword(str: string): boolean { return ( str === 'input_value' || str === 'input_statement' || @@ -2184,7 +2180,7 @@ export class Block implements IASTNodeLocation { * @param str String to turn into the JSON definition of a label field. * @returns The JSON definition or null. */ - private stringToFieldJson_(str: string): {text: string; type: string} | null { + private stringToFieldJson(str: string): {text: string; type: string} | null { str = str.trim(); if (str) { return { @@ -2445,7 +2441,7 @@ export class Block implements IASTNodeLocation { * @returns Object with .x and .y properties. */ getRelativeToSurfaceXY(): Coordinate { - return this.xy_; + return this.xy; } /** @@ -2461,7 +2457,7 @@ export class Block implements IASTNodeLocation { } const event = new (eventUtils.get(EventType.BLOCK_MOVE))(this) as BlockMove; if (reason) event.setReason(reason); - this.xy_.translate(dx, dy); + this.xy.translate(dx, dy); event.recordNew(); eventUtils.fire(event); } diff --git a/core/block_svg.ts b/core/block_svg.ts index 605d25fd4..1c1de49ec 100644 --- a/core/block_svg.ts +++ b/core/block_svg.ts @@ -145,7 +145,7 @@ export class BlockSvg /** Block's mutator icon (if any). */ mutator: MutatorIcon | null = null; - private svgGroup_: SVGGElement; + private svgGroup: SVGGElement; style: BlockStyle; /** @internal */ pathObject: IPathObject; @@ -155,15 +155,6 @@ export class BlockSvg private visuallyDisabled = false; - /** - * Is this block currently rendering? Used to stop recursive render calls - * from actually triggering a re-render. - */ - private renderIsInProgress_ = false; - - /** Whether mousedown events have been bound yet. */ - private eventsInit_ = false; - override workspace: WorkspaceSvg; // TODO(b/109816955): remove '!', see go/strict-prop-init-fix. override outputConnection!: RenderedConnection; @@ -201,7 +192,7 @@ export class BlockSvg throw TypeError('Cannot create a rendered block in a headless workspace'); } this.workspace = workspace; - this.svgGroup_ = dom.createSvgElement(Svg.G, {}); + this.svgGroup = dom.createSvgElement(Svg.G, {}); /** A block style object. */ this.style = workspace.getRenderer().getConstants().getBlockStyle(null); @@ -209,14 +200,14 @@ export class BlockSvg /** The renderer's path object. */ this.pathObject = workspace .getRenderer() - .makePathObject(this.svgGroup_, this.style); + .makePathObject(this.svgGroup, this.style); const svgPath = this.pathObject.svgPath; (svgPath as any).tooltip = this; Tooltip.bindMouseEvents(svgPath); // Expose this block's ID on its top-level SVG group. - this.svgGroup_.setAttribute('data-id', this.id); + this.svgGroup.setAttribute('data-id', this.id); this.doInit_(); } @@ -238,12 +229,7 @@ export class BlockSvg this.pathObject.updateMovable(this.isMovable() || this.isInFlyout); const svg = this.getSvgRoot(); if (!this.workspace.options.readOnly && svg) { - browserEvents.conditionalBind( - svg, - 'pointerdown', - this, - this.onMouseDown_, - ); + browserEvents.conditionalBind(svg, 'pointerdown', this, this.onMouseDown); } if (!svg.parentNode) { @@ -518,14 +504,14 @@ export class BlockSvg return; } super.setCollapsed(collapsed); - this.updateCollapsed_(); + this.updateCollapsed(); } /** * Makes sure that when the block is collapsed, it is rendered correctly * for that state. */ - private updateCollapsed_() { + private updateCollapsed() { const collapsed = this.isCollapsed(); const collapsedInputName = constants.COLLAPSED_INPUT_NAME; const collapsedFieldName = constants.COLLAPSED_FIELD_NAME; @@ -592,7 +578,7 @@ export class BlockSvg * * @param e Pointer down event. */ - private onMouseDown_(e: PointerEvent) { + private onMouseDown(e: PointerEvent) { const gesture = this.workspace.getGesture(e); if (gesture) { gesture.handleBlockStart(e, this); @@ -702,10 +688,10 @@ export class BlockSvg if (adding) { this.translation = ''; common.draggingConnections.push(...this.getConnections_(true)); - dom.addClass(this.svgGroup_, 'blocklyDragging'); + dom.addClass(this.svgGroup, 'blocklyDragging'); } else { common.draggingConnections.length = 0; - dom.removeClass(this.svgGroup_, 'blocklyDragging'); + dom.removeClass(this.svgGroup, 'blocklyDragging'); } // Recurse through all blocks attached under this one. for (let i = 0; i < this.childBlocks_.length; i++) { @@ -775,7 +761,7 @@ export class BlockSvg * @returns The root SVG node (probably a group). */ getSvgRoot(): SVGGElement { - return this.svgGroup_; + return this.svgGroup; } /** @@ -817,7 +803,7 @@ export class BlockSvg } super.dispose(!!healStack); - dom.removeNode(this.svgGroup_); + dom.removeNode(this.svgGroup); } /** @@ -1565,7 +1551,7 @@ export class BlockSvg dom.startTextWidthCache(); if (this.isCollapsed()) { - this.updateCollapsed_(); + this.updateCollapsed(); } if (!this.isEnabled()) { diff --git a/core/component_manager.ts b/core/component_manager.ts index fb89c38ae..8363d6fb4 100644 --- a/core/component_manager.ts +++ b/core/component_manager.ts @@ -23,10 +23,10 @@ class Capability<_T> { static DRAG_TARGET = new Capability('drag_target'); static DELETE_AREA = new Capability('delete_area'); static AUTOHIDEABLE = new Capability('autohideable'); - private readonly name_: string; + private readonly name: string; /** @param name The name of the component capability. */ constructor(name: string) { - this.name_ = name; + this.name = name; } /** @@ -35,7 +35,7 @@ class Capability<_T> { * @returns The name. */ toString(): string { - return this.name_; + return this.name; } } diff --git a/core/contextmenu_registry.ts b/core/contextmenu_registry.ts index abbd0f975..fb0d899d1 100644 --- a/core/contextmenu_registry.ts +++ b/core/contextmenu_registry.ts @@ -23,7 +23,7 @@ import type {WorkspaceSvg} from './workspace_svg.js'; export class ContextMenuRegistry { static registry: ContextMenuRegistry; /** Registry of all registered RegistryItems, keyed by ID. */ - private registry_ = new Map(); + private registeredItems = new Map(); /** Resets the existing singleton instance of ContextMenuRegistry. */ constructor() { @@ -32,7 +32,7 @@ export class ContextMenuRegistry { /** Clear and recreate the registry. */ reset() { - this.registry_.clear(); + this.registeredItems.clear(); } /** @@ -42,10 +42,10 @@ export class ContextMenuRegistry { * @throws {Error} if an item with the given ID already exists. */ register(item: RegistryItem) { - if (this.registry_.has(item.id)) { + if (this.registeredItems.has(item.id)) { throw Error('Menu item with ID "' + item.id + '" is already registered.'); } - this.registry_.set(item.id, item); + this.registeredItems.set(item.id, item); } /** @@ -55,10 +55,10 @@ export class ContextMenuRegistry { * @throws {Error} if an item with the given ID does not exist. */ unregister(id: string) { - if (!this.registry_.has(id)) { + if (!this.registeredItems.has(id)) { throw new Error('Menu item with ID "' + id + '" not found.'); } - this.registry_.delete(id); + this.registeredItems.delete(id); } /** @@ -66,7 +66,7 @@ export class ContextMenuRegistry { * @returns RegistryItem or null if not found */ getItem(id: string): RegistryItem | null { - return this.registry_.get(id) ?? null; + return this.registeredItems.get(id) ?? null; } /** @@ -85,7 +85,7 @@ export class ContextMenuRegistry { scope: Scope, ): ContextMenuOption[] { const menuOptions: ContextMenuOption[] = []; - for (const item of this.registry_.values()) { + for (const item of this.registeredItems.values()) { if (scopeType === item.scopeType) { const precondition = item.preconditionFn(scope); if (precondition !== 'hidden') { diff --git a/core/events/events_block_move.ts b/core/events/events_block_move.ts index cd683a777..99e162289 100644 --- a/core/events/events_block_move.ts +++ b/core/events/events_block_move.ts @@ -89,7 +89,7 @@ export class BlockMove extends BlockBase { this.recordUndo = false; } - const location = this.currentLocation_(); + const location = this.currentLocation(); this.oldParentId = location.parentId; this.oldInputName = location.inputName; this.oldCoordinate = location.coordinate; @@ -167,7 +167,7 @@ export class BlockMove extends BlockBase { /** Record the block's new location. Called after the move. */ recordNew() { - const location = this.currentLocation_(); + const location = this.currentLocation(); this.newParentId = location.parentId; this.newInputName = location.inputName; this.newCoordinate = location.coordinate; @@ -188,7 +188,7 @@ export class BlockMove extends BlockBase { * * @returns Collection of location info. */ - private currentLocation_(): BlockLocation { + private currentLocation(): BlockLocation { const workspace = this.getEventWorkspace_(); if (!this.blockId) { throw new Error( diff --git a/core/field.ts b/core/field.ts index c702abadc..4c4b90cf5 100644 --- a/core/field.ts +++ b/core/field.ts @@ -107,20 +107,20 @@ export abstract class Field * Used to cache the field's tooltip value if setTooltip is called when the * field is not yet initialized. Is *not* guaranteed to be accurate. */ - private tooltip_: Tooltip.TipInfo | null = null; + private tooltip: Tooltip.TipInfo | null = null; protected size_: Size; /** * Holds the cursors svg element when the cursor is attached to the field. * This is null if there is no cursor on the field. */ - private cursorSvg_: SVGElement | null = null; + private cursorSvg: SVGElement | null = null; /** * Holds the markers svg element when the marker is attached to the field. * This is null if there is no marker on the field. */ - private markerSvg_: SVGElement | null = null; + private markerSvg: SVGElement | null = null; /** The rendered field's SVG group element. */ protected fieldGroup_: SVGGElement | null = null; @@ -135,7 +135,7 @@ export abstract class Field protected textContent_: Text | null = null; /** Mouse down event listener data. */ - private mouseDownWrapper_: browserEvents.Data | null = null; + private mouseDownWrapper: browserEvents.Data | null = null; /** Constants associated with the source block's renderer. */ protected constants_: ConstantProvider | null = null; @@ -312,7 +312,7 @@ export abstract class Field sourceBlockSvg.getSvgRoot().appendChild(this.fieldGroup_); this.initView(); this.updateEditable(); - this.setTooltip(this.tooltip_); + this.setTooltip(this.tooltip); this.bindEvents_(); this.initModel(); this.applyColour(); @@ -393,7 +393,7 @@ export abstract class Field const clickTarget = this.getClickTarget_(); if (!clickTarget) throw new Error('A click target has not been set.'); Tooltip.bindMouseEvents(clickTarget); - this.mouseDownWrapper_ = browserEvents.conditionalBind( + this.mouseDownWrapper = browserEvents.conditionalBind( clickTarget, 'pointerdown', this, @@ -1095,7 +1095,7 @@ export abstract class Field try { const classValidation = this.doClassValidation_(newValue); - const classValue = this.processValidation_( + const classValue = this.processValidation( newValue, classValidation, fireChangeEvent, @@ -1106,7 +1106,7 @@ export abstract class Field } const localValidation = this.getValidator()?.call(this, classValue); - const localValue = this.processValidation_( + const localValue = this.processValidation( classValue, localValidation, fireChangeEvent, @@ -1158,7 +1158,7 @@ export abstract class Field * @param fireChangeEvent Whether to fire a change event if the value changes. * @returns New value, or an Error object. */ - private processValidation_( + private processValidation( newValue: AnyDuringMigration, validatedValue: T | null | undefined, fireChangeEvent: boolean, @@ -1272,7 +1272,7 @@ export abstract class Field (clickTarget as AnyDuringMigration).tooltip = newTip; } else { // Field has not been initialized yet. - this.tooltip_ = newTip; + this.tooltip = newTip; } } @@ -1286,8 +1286,8 @@ export abstract class Field if (clickTarget) { return Tooltip.getTooltipOfObject(clickTarget); } - // Field has not been initialized yet. Return stashed this.tooltip_ value. - return Tooltip.getTooltipOfObject({tooltip: this.tooltip_}); + // Field has not been initialized yet. Return stashed this.tooltip value. + return Tooltip.getTooltipOfObject({tooltip: this.tooltip}); } /** @@ -1396,7 +1396,7 @@ export abstract class Field */ setCursorSvg(cursorSvg: SVGElement) { if (!cursorSvg) { - this.cursorSvg_ = null; + this.cursorSvg = null; return; } @@ -1404,7 +1404,7 @@ export abstract class Field throw new Error(`The field group is ${this.fieldGroup_}.`); } this.fieldGroup_.appendChild(cursorSvg); - this.cursorSvg_ = cursorSvg; + this.cursorSvg = cursorSvg; } /** @@ -1415,7 +1415,7 @@ export abstract class Field */ setMarkerSvg(markerSvg: SVGElement) { if (!markerSvg) { - this.markerSvg_ = null; + this.markerSvg = null; return; } @@ -1423,7 +1423,7 @@ export abstract class Field throw new Error(`The field group is ${this.fieldGroup_}.`); } this.fieldGroup_.appendChild(markerSvg); - this.markerSvg_ = markerSvg; + this.markerSvg = markerSvg; } /** @@ -1437,10 +1437,10 @@ export abstract class Field throw new UnattachedFieldError(); } const workspace = block.workspace as WorkspaceSvg; - if (workspace.keyboardAccessibilityMode && this.cursorSvg_) { + if (workspace.keyboardAccessibilityMode && this.cursorSvg) { workspace.getCursor()!.draw(); } - if (workspace.keyboardAccessibilityMode && this.markerSvg_) { + if (workspace.keyboardAccessibilityMode && this.markerSvg) { // TODO(#4592): Update all markers on the field. workspace.getMarker(MarkerManager.LOCAL_MARKER)!.draw(); } diff --git a/core/field_checkbox.ts b/core/field_checkbox.ts index 01d1851aa..5ae3dfda1 100644 --- a/core/field_checkbox.ts +++ b/core/field_checkbox.ts @@ -170,7 +170,7 @@ export class FieldCheckbox extends Field { * that this is a either 'TRUE' or 'FALSE'. */ protected override doValueUpdate_(newValue: BoolString) { - this.value_ = this.convertValueToBool_(newValue); + this.value_ = this.convertValueToBool(newValue); // Update visual. if (this.textElement_) { this.textElement_.style.display = this.value_ ? 'block' : 'none'; @@ -201,7 +201,7 @@ export class FieldCheckbox extends Field { * @returns Text representing the value of this field ('true' or 'false'). */ override getText(): string { - return String(this.convertValueToBool_(this.value_)); + return String(this.convertValueToBool(this.value_)); } /** @@ -213,7 +213,7 @@ export class FieldCheckbox extends Field { * @param value The value to convert. * @returns The converted value. */ - private convertValueToBool_(value: CheckboxBool | null): boolean { + private convertValueToBool(value: CheckboxBool | null): boolean { if (typeof value === 'string') return value === 'TRUE'; return !!value; } diff --git a/core/field_input.ts b/core/field_input.ts index 722316f4f..eecb4ec94 100644 --- a/core/field_input.ts +++ b/core/field_input.ts @@ -80,10 +80,10 @@ export abstract class FieldInput extends Field< protected valueWhenEditorWasOpened_: string | T | null = null; /** Key down event data. */ - private onKeyDownWrapper_: browserEvents.Data | null = null; + private onKeyDownWrapper: browserEvents.Data | null = null; /** Key input event data. */ - private onKeyInputWrapper_: browserEvents.Data | null = null; + private onKeyInputWrapper: browserEvents.Data | null = null; /** * Whether the field should consider the whole parent block to be its click @@ -338,9 +338,9 @@ export abstract class FieldInput extends Field< this.workspace_.options.modalInputs && (userAgent.MOBILE || userAgent.ANDROID || userAgent.IPAD) ) { - this.showPromptEditor_(); + this.showPromptEditor(); } else { - this.showInlineEditor_(quietInput); + this.showInlineEditor(quietInput); } } @@ -349,7 +349,7 @@ export abstract class FieldInput extends Field< * Mobile browsers may have issues with in-line textareas (focus and * keyboards). */ - private showPromptEditor_() { + private showPromptEditor() { dialog.prompt( Msg['CHANGE_VALUE_TITLE'], this.getText(), @@ -368,7 +368,7 @@ export abstract class FieldInput extends Field< * * @param quietInput True if editor should be created without focus. */ - private showInlineEditor_(quietInput: boolean) { + private showInlineEditor(quietInput: boolean) { const block = this.getSourceBlock(); if (!block) { throw new UnattachedFieldError(); @@ -518,30 +518,30 @@ export abstract class FieldInput extends Field< */ protected bindInputEvents_(htmlInput: HTMLElement) { // Trap Enter without IME and Esc to hide. - this.onKeyDownWrapper_ = browserEvents.conditionalBind( + this.onKeyDownWrapper = browserEvents.conditionalBind( htmlInput, 'keydown', this, this.onHtmlInputKeyDown_, ); // Resize after every input change. - this.onKeyInputWrapper_ = browserEvents.conditionalBind( + this.onKeyInputWrapper = browserEvents.conditionalBind( htmlInput, 'input', this, - this.onHtmlInputChange_, + this.onHtmlInputChange, ); } /** Unbind handlers for user input and workspace size changes. */ protected unbindInputEvents_() { - if (this.onKeyDownWrapper_) { - browserEvents.unbind(this.onKeyDownWrapper_); - this.onKeyDownWrapper_ = null; + if (this.onKeyDownWrapper) { + browserEvents.unbind(this.onKeyDownWrapper); + this.onKeyDownWrapper = null; } - if (this.onKeyInputWrapper_) { - browserEvents.unbind(this.onKeyInputWrapper_); - this.onKeyInputWrapper_ = null; + if (this.onKeyInputWrapper) { + browserEvents.unbind(this.onKeyInputWrapper); + this.onKeyInputWrapper = null; } } @@ -574,7 +574,7 @@ export abstract class FieldInput extends Field< * * @param _e Keyboard event. */ - private onHtmlInputChange_(_e: Event) { + private onHtmlInputChange(_e: Event) { // Intermediate value changes from user input are not confirmed until the // user closes the editor, and may be numerous. Inhibit reporting these as // normal block change events, and instead report them as special diff --git a/core/flyout_base.ts b/core/flyout_base.ts index ccfb91ed0..96d2b27fd 100644 --- a/core/flyout_base.ts +++ b/core/flyout_base.ts @@ -207,7 +207,7 @@ export abstract class Flyout /** * Whether the flyout is visible. */ - private isVisible_ = false; + private visible = false; /** * Whether the workspace containing this flyout is visible. @@ -286,7 +286,7 @@ export abstract class Flyout this.workspace_.internalIsFlyout = true; // Keep the workspace visibility consistent with the flyout's visibility. - this.workspace_.setVisible(this.isVisible_); + this.workspace_.setVisible(this.visible); /** * The unique id for this component that is used to register with the @@ -532,7 +532,7 @@ export abstract class Flyout * @returns True if visible. */ isVisible(): boolean { - return this.isVisible_; + return this.visible; } /** @@ -545,7 +545,7 @@ export abstract class Flyout setVisible(visible: boolean) { const visibilityChanged = visible !== this.isVisible(); - this.isVisible_ = visible; + this.visible = visible; if (visibilityChanged) { if (!this.autoClose) { // Auto-close flyouts are ignored as drag targets, so only non diff --git a/core/flyout_metrics_manager.ts b/core/flyout_metrics_manager.ts index a291f4c3b..00f675caa 100644 --- a/core/flyout_metrics_manager.ts +++ b/core/flyout_metrics_manager.ts @@ -38,7 +38,7 @@ export class FlyoutMetricsManager extends MetricsManager { * * @returns The bounding box of the blocks on the workspace. */ - private getBoundingBox_(): + private getBoundingBox(): | SVGRect | {height: number; y: number; width: number; x: number} { let blockBoundingBox; @@ -55,7 +55,7 @@ export class FlyoutMetricsManager extends MetricsManager { override getContentMetrics(opt_getWorkspaceCoordinates?: boolean) { // The bounding box is in workspace coordinates. - const blockBoundingBox = this.getBoundingBox_(); + const blockBoundingBox = this.getBoundingBox(); const scale = opt_getWorkspaceCoordinates ? 1 : this.workspace_.scale; return { diff --git a/core/gesture.ts b/core/gesture.ts index a71eb861e..0b65299e5 100644 --- a/core/gesture.ts +++ b/core/gesture.ts @@ -146,7 +146,7 @@ export class Gesture { private mostRecentEvent: PointerEvent; /** Boolean for whether or not this gesture is a multi-touch gesture. */ - private isMultiTouch_ = false; + private multiTouch = false; /** A map of cached points used for tracking multi-touch gestures. */ private cachedPoints = new Map(); @@ -586,7 +586,7 @@ export class Gesture { const point0 = this.cachedPoints.get(pointers[0])!; const point1 = this.cachedPoints.get(pointers[1])!; this.startDistance = Coordinate.distance(point0, point1); - this.isMultiTouch_ = true; + this.multiTouch = true; e.preventDefault(); } } @@ -691,7 +691,7 @@ export class Gesture { * @internal */ isMultiTouch(): boolean { - return this.isMultiTouch_; + return this.multiTouch; } /** diff --git a/core/marker_manager.ts b/core/marker_manager.ts index bd243c005..d7035534d 100644 --- a/core/marker_manager.ts +++ b/core/marker_manager.ts @@ -23,16 +23,16 @@ export class MarkerManager { static readonly LOCAL_MARKER = 'local_marker_1'; /** The cursor. */ - private cursor_: Cursor | null = null; + private cursor: Cursor | null = null; /** The cursor's SVG element. */ - private cursorSvg_: SVGElement | null = null; + private cursorSvg: SVGElement | null = null; /** The map of markers for the workspace. */ private markers = new Map(); /** The marker's SVG element. */ - private markerSvg_: SVGElement | null = null; + private markerSvg: SVGElement | null = null; /** * @param workspace The workspace for the marker manager. @@ -83,7 +83,7 @@ export class MarkerManager { * @returns The cursor for this workspace. */ getCursor(): Cursor | null { - return this.cursor_; + return this.cursor; } /** @@ -104,16 +104,16 @@ export class MarkerManager { * @param cursor The cursor used to move around this workspace. */ setCursor(cursor: Cursor) { - if (this.cursor_ && this.cursor_.getDrawer()) { - this.cursor_.getDrawer().dispose(); + if (this.cursor && this.cursor.getDrawer()) { + this.cursor.getDrawer().dispose(); } - this.cursor_ = cursor; - if (this.cursor_) { + this.cursor = cursor; + if (this.cursor) { const drawer = this.workspace .getRenderer() - .makeMarkerDrawer(this.workspace, this.cursor_); - this.cursor_.setDrawer(drawer); - this.setCursorSvg(this.cursor_.getDrawer().createDom()); + .makeMarkerDrawer(this.workspace, this.cursor); + this.cursor.setDrawer(drawer); + this.setCursorSvg(this.cursor.getDrawer().createDom()); } } @@ -126,12 +126,12 @@ export class MarkerManager { */ setCursorSvg(cursorSvg: SVGElement | null) { if (!cursorSvg) { - this.cursorSvg_ = null; + this.cursorSvg = null; return; } this.workspace.getBlockCanvas()!.appendChild(cursorSvg); - this.cursorSvg_ = cursorSvg; + this.cursorSvg = cursorSvg; } /** @@ -143,15 +143,15 @@ export class MarkerManager { */ setMarkerSvg(markerSvg: SVGElement | null) { if (!markerSvg) { - this.markerSvg_ = null; + this.markerSvg = null; return; } if (this.workspace.getBlockCanvas()) { - if (this.cursorSvg_) { + if (this.cursorSvg) { this.workspace .getBlockCanvas()! - .insertBefore(markerSvg, this.cursorSvg_); + .insertBefore(markerSvg, this.cursorSvg); } else { this.workspace.getBlockCanvas()!.appendChild(markerSvg); } @@ -164,7 +164,7 @@ export class MarkerManager { * @internal */ updateMarkers() { - if (this.workspace.keyboardAccessibilityMode && this.cursorSvg_) { + if (this.workspace.keyboardAccessibilityMode && this.cursorSvg) { this.workspace.getCursor()!.draw(); } } @@ -181,9 +181,9 @@ export class MarkerManager { this.unregisterMarker(markerId); } this.markers.clear(); - if (this.cursor_) { - this.cursor_.dispose(); - this.cursor_ = null; + if (this.cursor) { + this.cursor.dispose(); + this.cursor = null; } } } diff --git a/core/options.ts b/core/options.ts index 42d2b41de..539fd3f6f 100644 --- a/core/options.ts +++ b/core/options.ts @@ -167,7 +167,7 @@ export class Options { this.modalInputs = modalInputs; this.pathToMedia = pathToMedia; this.hasCategories = hasCategories; - this.moveOptions = Options.parseMoveOptions_(options, hasCategories); + this.moveOptions = Options.parseMoveOptions(options, hasCategories); this.hasScrollbars = !!this.moveOptions.scrollbars; this.hasTrashcan = hasTrashcan; this.maxTrashcanContents = maxTrashcanContents; @@ -175,10 +175,10 @@ export class Options { this.hasCss = hasCss; this.horizontalLayout = horizontalLayout; this.languageTree = toolboxJsonDef; - this.gridOptions = Options.parseGridOptions_(options); - this.zoomOptions = Options.parseZoomOptions_(options); + this.gridOptions = Options.parseGridOptions(options); + this.zoomOptions = Options.parseZoomOptions(options); this.toolboxPosition = toolboxPosition; - this.theme = Options.parseThemeOptions_(options); + this.theme = Options.parseThemeOptions(options); this.renderer = renderer; this.rendererOverrides = options['rendererOverrides'] ?? null; @@ -201,7 +201,7 @@ export class Options { * @param hasCategories Whether the workspace has categories or not. * @returns Normalized move options. */ - private static parseMoveOptions_( + private static parseMoveOptions( options: BlocklyOptions, hasCategories: boolean, ): MoveOptions { @@ -260,7 +260,7 @@ export class Options { * @param options Dictionary of options. * @returns Normalized zoom options. */ - private static parseZoomOptions_(options: BlocklyOptions): ZoomOptions { + private static parseZoomOptions(options: BlocklyOptions): ZoomOptions { const zoom = options['zoom'] || {}; const zoomOptions = {} as ZoomOptions; if (zoom['controls'] === undefined) { @@ -309,7 +309,7 @@ export class Options { * @param options Dictionary of options. * @returns Normalized grid options. */ - private static parseGridOptions_(options: BlocklyOptions): GridOptions { + private static parseGridOptions(options: BlocklyOptions): GridOptions { const grid = options['grid'] || {}; const gridOptions = {} as GridOptions; gridOptions.spacing = Number(grid['spacing']) || 0; @@ -327,7 +327,7 @@ export class Options { * @param options Dictionary of options. * @returns A Blockly Theme. */ - private static parseThemeOptions_(options: BlocklyOptions): Theme { + private static parseThemeOptions(options: BlocklyOptions): Theme { const theme = options['theme'] || Classic; if (typeof theme === 'string') { return registry.getObject(registry.Type.THEME, theme) as Theme; diff --git a/core/scrollbar_pair.ts b/core/scrollbar_pair.ts index 231fe56f8..79ecff834 100644 --- a/core/scrollbar_pair.ts +++ b/core/scrollbar_pair.ts @@ -27,7 +27,7 @@ export class ScrollbarPair { corner_: SVGRectElement | null = null; /** Previously recorded metrics from the workspace. */ - private oldHostMetrics_: Metrics | null = null; + private oldHostMetrics: Metrics | null = null; /** * @param workspace Workspace to bind the scrollbars to. @@ -84,7 +84,7 @@ export class ScrollbarPair { dispose() { dom.removeNode(this.corner_); this.corner_ = null; - this.oldHostMetrics_ = null; + this.oldHostMetrics = null; if (this.hScroll) { this.hScroll.dispose(); this.hScroll = null; @@ -111,11 +111,11 @@ export class ScrollbarPair { let resizeH = false; let resizeV = false; if ( - !this.oldHostMetrics_ || - this.oldHostMetrics_.viewWidth !== hostMetrics.viewWidth || - this.oldHostMetrics_.viewHeight !== hostMetrics.viewHeight || - this.oldHostMetrics_.absoluteTop !== hostMetrics.absoluteTop || - this.oldHostMetrics_.absoluteLeft !== hostMetrics.absoluteLeft + !this.oldHostMetrics || + this.oldHostMetrics.viewWidth !== hostMetrics.viewWidth || + this.oldHostMetrics.viewHeight !== hostMetrics.viewHeight || + this.oldHostMetrics.absoluteTop !== hostMetrics.absoluteTop || + this.oldHostMetrics.absoluteLeft !== hostMetrics.absoluteLeft ) { // The window has been resized or repositioned. resizeH = true; @@ -123,18 +123,18 @@ export class ScrollbarPair { } else { // Has the content been resized or moved? if ( - !this.oldHostMetrics_ || - this.oldHostMetrics_.scrollWidth !== hostMetrics.scrollWidth || - this.oldHostMetrics_.viewLeft !== hostMetrics.viewLeft || - this.oldHostMetrics_.scrollLeft !== hostMetrics.scrollLeft + !this.oldHostMetrics || + this.oldHostMetrics.scrollWidth !== hostMetrics.scrollWidth || + this.oldHostMetrics.viewLeft !== hostMetrics.viewLeft || + this.oldHostMetrics.scrollLeft !== hostMetrics.scrollLeft ) { resizeH = true; } if ( - !this.oldHostMetrics_ || - this.oldHostMetrics_.scrollHeight !== hostMetrics.scrollHeight || - this.oldHostMetrics_.viewTop !== hostMetrics.viewTop || - this.oldHostMetrics_.scrollTop !== hostMetrics.scrollTop + !this.oldHostMetrics || + this.oldHostMetrics.scrollHeight !== hostMetrics.scrollHeight || + this.oldHostMetrics.viewTop !== hostMetrics.viewTop || + this.oldHostMetrics.scrollTop !== hostMetrics.scrollTop ) { resizeV = true; } @@ -158,23 +158,23 @@ export class ScrollbarPair { if (this.hScroll && this.vScroll) { // Reposition the corner square. if ( - !this.oldHostMetrics_ || - this.oldHostMetrics_.viewWidth !== hostMetrics.viewWidth || - this.oldHostMetrics_.absoluteLeft !== hostMetrics.absoluteLeft + !this.oldHostMetrics || + this.oldHostMetrics.viewWidth !== hostMetrics.viewWidth || + this.oldHostMetrics.absoluteLeft !== hostMetrics.absoluteLeft ) { this.corner_?.setAttribute('x', String(this.vScroll.position.x)); } if ( - !this.oldHostMetrics_ || - this.oldHostMetrics_.viewHeight !== hostMetrics.viewHeight || - this.oldHostMetrics_.absoluteTop !== hostMetrics.absoluteTop + !this.oldHostMetrics || + this.oldHostMetrics.viewHeight !== hostMetrics.viewHeight || + this.oldHostMetrics.absoluteTop !== hostMetrics.absoluteTop ) { this.corner_?.setAttribute('y', String(this.hScroll.position.y)); } } // Cache the current metrics to potentially short-cut the next resize event. - this.oldHostMetrics_ = hostMetrics; + this.oldHostMetrics = hostMetrics; } /** diff --git a/core/shortcut_registry.ts b/core/shortcut_registry.ts index 32615c866..09bd867e7 100644 --- a/core/shortcut_registry.ts +++ b/core/shortcut_registry.ts @@ -242,7 +242,7 @@ export class ShortcutRegistry { * @returns True if the event was handled, false otherwise. */ onKeyDown(workspace: WorkspaceSvg, e: KeyboardEvent): boolean { - const key = this.serializeKeyEvent_(e); + const key = this.serializeKeyEvent(e); const shortcutNames = this.getShortcutNamesByKeyCode(key); if (!shortcutNames) return false; for (const shortcutName of shortcutNames) { @@ -294,7 +294,7 @@ export class ShortcutRegistry { * @param e A key down event. * @returns The serialized key code for the given event. */ - private serializeKeyEvent_(e: KeyboardEvent): string { + private serializeKeyEvent(e: KeyboardEvent): string { let serializedKey = ''; for (const modifier in ShortcutRegistry.modifierKeys) { if (e.getModifierState(modifier)) { @@ -318,7 +318,7 @@ export class ShortcutRegistry { * @param modifiers List of modifiers to be used with the key. * @throws {Error} if the modifier is not in the valid modifiers list. */ - private checkModifiers_(modifiers: KeyCodes[]) { + private checkModifiers(modifiers: KeyCodes[]) { for (const modifier of modifiers) { if (!(modifier in ShortcutRegistry.modifierKeys)) { throw new Error(modifier + ' is not a valid modifier key.'); @@ -338,7 +338,7 @@ export class ShortcutRegistry { let serializedKey = ''; if (modifiers) { - this.checkModifiers_(modifiers); + this.checkModifiers(modifiers); for (const modifier in ShortcutRegistry.modifierKeys) { const modifierKeyCode = ( ShortcutRegistry.modifierKeys as AnyDuringMigration diff --git a/core/theme_manager.ts b/core/theme_manager.ts index 8d2ad72db..966ca3fd2 100644 --- a/core/theme_manager.ts +++ b/core/theme_manager.ts @@ -23,7 +23,7 @@ import type {WorkspaceSvg} from './workspace_svg.js'; */ export class ThemeManager { /** A list of workspaces that are subscribed to this theme. */ - private subscribedWorkspaces_: Workspace[] = []; + private subscribedWorkspaces: Workspace[] = []; private componentDB = new Map(); /** @@ -73,7 +73,7 @@ export class ThemeManager { // Refresh all subscribed workspaces. for ( let i = 0, workspace; - (workspace = this.subscribedWorkspaces_[i]); + (workspace = this.subscribedWorkspaces[i]); i++ ) { (workspace as WorkspaceSvg).refreshTheme(); @@ -89,7 +89,7 @@ export class ThemeManager { } } - for (const workspace of this.subscribedWorkspaces_) { + for (const workspace of this.subscribedWorkspaces) { (workspace as WorkspaceSvg).hideChaff(); } } @@ -102,7 +102,7 @@ export class ThemeManager { * @internal */ subscribeWorkspace(workspace: Workspace) { - this.subscribedWorkspaces_.push(workspace); + this.subscribedWorkspaces.push(workspace); } /** @@ -112,7 +112,7 @@ export class ThemeManager { * @internal */ unsubscribeWorkspace(workspace: Workspace) { - if (!arrayUtils.removeElem(this.subscribedWorkspaces_, workspace)) { + if (!arrayUtils.removeElem(this.subscribedWorkspaces, workspace)) { throw Error( "Cannot unsubscribe a workspace that hasn't been subscribed.", ); @@ -176,7 +176,7 @@ export class ThemeManager { * @internal */ dispose() { - this.subscribedWorkspaces_.length = 0; + this.subscribedWorkspaces.length = 0; this.componentDB.clear(); } } diff --git a/core/toolbox/category.ts b/core/toolbox/category.ts index 5bdeca223..1394f7218 100644 --- a/core/toolbox/category.ts +++ b/core/toolbox/category.ts @@ -347,9 +347,9 @@ export class ToolboxCategory '" must not have both a style and a colour', ); } else if (styleName) { - return this.getColourfromStyle_(styleName); + return this.getColourfromStyle(styleName); } else if (colour) { - return this.parseColour_(colour); + return this.parseColour(colour); } return ''; } @@ -361,12 +361,12 @@ export class ToolboxCategory * @param styleName Name of the style. * @returns The hex colour for the category. */ - private getColourfromStyle_(styleName: string): string { + private getColourfromStyle(styleName: string): string { const theme = this.workspace_.getTheme(); if (styleName && theme) { const style = theme.categoryStyles[styleName]; if (style && style.colour) { - return this.parseColour_(style.colour); + return this.parseColour(style.colour); } else { console.warn( 'Style "' + styleName + '" must exist and contain a colour value', @@ -395,7 +395,7 @@ export class ToolboxCategory * reference string pointing to one of those two values. * @returns The hex colour for the category. */ - private parseColour_(colourValue: number | string): string { + private parseColour(colourValue: number | string): string { // Decode the colour for any potential message references // (eg. `%{BKY_MATH_HUE}`). const colour = parsing.replaceMessageReferences(colourValue); @@ -541,7 +541,7 @@ export class ToolboxCategory } const className = this.cssConfig_['selected']; if (isSelected) { - const defaultColour = this.parseColour_( + const defaultColour = this.parseColour( ToolboxCategory.defaultBackgroundColour, ); this.rowDiv_.style.backgroundColor = this.colour_ || defaultColour; diff --git a/core/toolbox/collapsible_category.ts b/core/toolbox/collapsible_category.ts index e51db4f68..591436425 100644 --- a/core/toolbox/collapsible_category.ts +++ b/core/toolbox/collapsible_category.ts @@ -83,7 +83,7 @@ export class CollapsibleToolboxCategory this.flyoutItems_.push(flyoutItem); prevIsFlyoutItem = true; } else { - this.createToolboxItem_(itemDef); + this.createToolboxItem(itemDef); prevIsFlyoutItem = false; } } @@ -95,7 +95,7 @@ export class CollapsibleToolboxCategory * * @param itemDef The information needed to create a toolbox item. */ - private createToolboxItem_(itemDef: toolbox.ToolboxItemInfo) { + private createToolboxItem(itemDef: toolbox.ToolboxItemInfo) { let registryName = itemDef['kind']; const categoryDef = itemDef as toolbox.CategoryInfo; // Categories that are collapsible are created using a class registered diff --git a/core/toolbox/separator.ts b/core/toolbox/separator.ts index 5e899054a..23874e42e 100644 --- a/core/toolbox/separator.ts +++ b/core/toolbox/separator.ts @@ -29,7 +29,7 @@ export class ToolboxSeparator extends ToolboxItem { /** All the CSS class names that are used to create a separator. */ protected cssConfig_: CssConfig = {'container': 'blocklyTreeSeparator'}; - private htmlDiv_: HTMLDivElement | null = null; + private htmlDiv: HTMLDivElement | null = null; /** * @param separatorDef The information needed to create a separator. @@ -58,16 +58,16 @@ export class ToolboxSeparator extends ToolboxItem { if (className) { dom.addClass(container, className); } - this.htmlDiv_ = container; + this.htmlDiv = container; return container; } override getDiv() { - return this.htmlDiv_ as HTMLDivElement; + return this.htmlDiv as HTMLDivElement; } override dispose() { - dom.removeNode(this.htmlDiv_ as HTMLDivElement); + dom.removeNode(this.htmlDiv as HTMLDivElement); } } diff --git a/core/toolbox/toolbox.ts b/core/toolbox/toolbox.ts index 5d6eee90a..457d5d43b 100644 --- a/core/toolbox/toolbox.ts +++ b/core/toolbox/toolbox.ts @@ -59,7 +59,7 @@ export class Toolbox */ override id = 'toolbox'; protected toolboxDef_: toolbox.ToolboxInfo; - private readonly horizontalLayout_: boolean; + private readonly horizontalLayout: boolean; /** The HTML container for the toolbox. */ HtmlDiv: HTMLDivElement | null = null; @@ -81,7 +81,7 @@ export class Toolbox RTL: boolean; /** The flyout for the toolbox. */ - private flyout_: IFlyout | null = null; + private flyout: IFlyout | null = null; protected contentMap_: {[key: string]: IToolboxItem}; toolboxPosition: toolbox.Position; @@ -113,7 +113,7 @@ export class Toolbox }; /** Whether the toolbox should be laid out horizontally. */ - this.horizontalLayout_ = workspace.options.horizontalLayout; + this.horizontalLayout = workspace.options.horizontalLayout; /** Is RTL vs LTR. */ this.RTL = workspace.options.RTL; @@ -140,12 +140,12 @@ export class Toolbox const workspace = this.workspace_; const svg = workspace.getParentSvg(); - this.flyout_ = this.createFlyout_(); + this.flyout = this.createFlyout_(); this.HtmlDiv = this.createDom_(this.workspace_); - dom.insertAfter(this.flyout_.createDom('svg'), svg); + dom.insertAfter(this.flyout.createDom('svg'), svg); this.setVisible(true); - this.flyout_.init(workspace); + this.flyout.init(workspace); this.render(this.toolboxDef_); const themeManager = workspace.getThemeManager(); @@ -281,16 +281,16 @@ export class Toolbox let handled = false; switch (e.key) { case 'ArrowDown': - handled = this.selectNext_(); + handled = this.selectNext(); break; case 'ArrowUp': - handled = this.selectPrevious_(); + handled = this.selectPrevious(); break; case 'ArrowLeft': - handled = this.selectParent_(); + handled = this.selectParent(); break; case 'ArrowRight': - handled = this.selectChild_(); + handled = this.selectChild(); break; case 'Enter': case ' ': @@ -391,7 +391,7 @@ export class Toolbox const fragment = document.createDocumentFragment(); for (let i = 0; i < toolboxDef.length; i++) { const toolboxItemDef = toolboxDef[i]; - this.createToolboxItem_(toolboxItemDef, fragment); + this.createToolboxItem(toolboxItemDef, fragment); } this.contentsDiv_!.appendChild(fragment); } @@ -403,7 +403,7 @@ export class Toolbox * the toolbox. * @param fragment The document fragment to add the child toolbox elements to. */ - private createToolboxItem_( + private createToolboxItem( toolboxItemDef: toolbox.ToolboxItemInfo, fragment: DocumentFragment, ) { @@ -644,7 +644,7 @@ export class Toolbox * @returns The toolbox flyout. */ getFlyout(): IFlyout | null { - return this.flyout_; + return this.flyout; } /** @@ -682,7 +682,7 @@ export class Toolbox * vertical. */ isHorizontal(): boolean { - return this.horizontalLayout_; + return this.horizontalLayout; } /** @@ -697,7 +697,7 @@ export class Toolbox return; } - if (this.horizontalLayout_) { + if (this.horizontalLayout) { toolboxDiv.style.left = '0'; toolboxDiv.style.height = 'auto'; toolboxDiv.style.width = '100%'; @@ -720,7 +720,7 @@ export class Toolbox this.width_ = toolboxDiv.offsetWidth; this.height_ = workspaceMetrics.viewHeight; } - this.flyout_!.position(); + this.flyout!.position(); } /** @@ -780,7 +780,7 @@ export class Toolbox this.selectedItem_.isSelectable() && this.selectedItem_.getContents().length ) { - this.flyout_!.show(this.selectedItem_.getContents()); + this.flyout!.show(this.selectedItem_.getContents()); } } @@ -808,7 +808,7 @@ export class Toolbox * Flyouts should not be closed if this is true. */ autoHide(onlyClosePopups: boolean) { - if (!onlyClosePopups && this.flyout_ && this.flyout_.autoClose) { + if (!onlyClosePopups && this.flyout && this.flyout.autoClose) { this.clearSelection(); } } @@ -838,7 +838,7 @@ export class Toolbox } this.updateFlyout_(oldItem, newItem); - this.fireSelectEvent_(oldItem, newItem); + this.fireSelectEvent(oldItem, newItem); } /** @@ -940,10 +940,10 @@ export class Toolbox (oldItem === newItem && !newItem.isCollapsible()) || !newItem.getContents().length ) { - this.flyout_!.hide(); + this.flyout!.hide(); } else { - this.flyout_!.show(newItem.getContents()); - this.flyout_!.scrollToStart(); + this.flyout!.show(newItem.getContents()); + this.flyout!.scrollToStart(); } } @@ -953,7 +953,7 @@ export class Toolbox * @param oldItem The previously selected toolbox item. * @param newItem The newly selected toolbox item. */ - private fireSelectEvent_( + private fireSelectEvent( oldItem: ISelectableToolboxItem | null, newItem: ISelectableToolboxItem | null, ) { @@ -976,7 +976,7 @@ export class Toolbox * * @returns True if a parent category was selected, false otherwise. */ - private selectParent_(): boolean { + private selectParent(): boolean { if (!this.selectedItem_) { return false; } @@ -1004,7 +1004,7 @@ export class Toolbox * * @returns True if a child category was selected, false otherwise. */ - private selectChild_(): boolean { + private selectChild(): boolean { if (!this.selectedItem_ || !this.selectedItem_.isCollapsible()) { return false; } @@ -1013,7 +1013,7 @@ export class Toolbox collapsibleItem.toggleExpanded(); return true; } else { - this.selectNext_(); + this.selectNext(); return true; } } @@ -1023,7 +1023,7 @@ export class Toolbox * * @returns True if a next category was selected, false otherwise. */ - private selectNext_(): boolean { + private selectNext(): boolean { if (!this.selectedItem_) { return false; } @@ -1047,7 +1047,7 @@ export class Toolbox * * @returns True if a previous category was selected, false otherwise. */ - private selectPrevious_(): boolean { + private selectPrevious(): boolean { if (!this.selectedItem_) { return false; } @@ -1069,7 +1069,7 @@ export class Toolbox /** Disposes of this toolbox. */ dispose() { this.workspace_.getComponentManager().removeComponent('toolbox'); - this.flyout_!.dispose(); + this.flyout!.dispose(); for (let i = 0; i < this.contents_.length; i++) { const toolboxItem = this.contents_[i]; toolboxItem.dispose(); diff --git a/core/variable_map.ts b/core/variable_map.ts index a67461741..b28e8a355 100644 --- a/core/variable_map.ts +++ b/core/variable_map.ts @@ -76,14 +76,9 @@ export class VariableMap { // The IDs may match if the rename is a simple case change (name1 -> // Name1). if (!conflictVar || conflictVar.getId() === variable.getId()) { - this.renameVariableAndUses_(variable, newName, blocks); + this.renameVariableAndUses(variable, newName, blocks); } else { - this.renameVariableWithConflict_( - variable, - newName, - conflictVar, - blocks, - ); + this.renameVariableWithConflict(variable, newName, conflictVar, blocks); } } finally { eventUtils.setGroup(existingGroup); @@ -114,7 +109,7 @@ export class VariableMap { * @param newName New variable name. * @param blocks The list of all blocks in the workspace. */ - private renameVariableAndUses_( + private renameVariableAndUses( variable: VariableModel, newName: string, blocks: Block[], @@ -139,7 +134,7 @@ export class VariableMap { * @param conflictVar The variable that was already using newName. * @param blocks The list of all blocks in the workspace. */ - private renameVariableWithConflict_( + private renameVariableWithConflict( variable: VariableModel, newName: string, conflictVar: VariableModel, @@ -150,7 +145,7 @@ export class VariableMap { if (newName !== oldCase) { // Simple rename to change the case and update references. - this.renameVariableAndUses_(conflictVar, newName, blocks); + this.renameVariableAndUses(conflictVar, newName, blocks); } // These blocks now refer to a different variable. diff --git a/core/variable_model.ts b/core/variable_model.ts index 0728a3d56..58e48f362 100644 --- a/core/variable_model.ts +++ b/core/variable_model.ts @@ -25,7 +25,7 @@ import type {Workspace} from './workspace.js'; */ export class VariableModel { type: string; - private readonly id_: string; + private readonly id: string; /** * @param workspace The variable's workspace. @@ -56,12 +56,12 @@ export class VariableModel { * not change, even if the name changes. In most cases this should be a * UUID. */ - this.id_ = opt_id || idGenerator.genUid(); + this.id = opt_id || idGenerator.genUid(); } /** @returns The ID for the variable. */ getId(): string { - return this.id_; + return this.id; } /** diff --git a/core/workspace.ts b/core/workspace.ts index 75bcd8147..89c797237 100644 --- a/core/workspace.ts +++ b/core/workspace.ts @@ -167,7 +167,7 @@ export class Workspace implements IASTNodeLocation { * @returns The comparison value. This tells Array.sort() how to change object * a's index. */ - private sortObjects_( + private sortObjects( a: Block | WorkspaceComment, b: Block | WorkspaceComment, ): number { @@ -209,7 +209,7 @@ export class Workspace implements IASTNodeLocation { // Copy the topBlocks list. const blocks = new Array().concat(this.topBlocks); if (ordered && blocks.length > 1) { - blocks.sort(this.sortObjects_.bind(this)); + blocks.sort(this.sortObjects.bind(this)); } return blocks; } @@ -252,7 +252,7 @@ export class Workspace implements IASTNodeLocation { } const blocks = this.typedBlocksDB.get(type)!.slice(0); if (ordered && blocks && blocks.length > 1) { - blocks.sort(this.sortObjects_.bind(this)); + blocks.sort(this.sortObjects.bind(this)); } return blocks.filter((block) => !block.isInsertionMarker()); @@ -308,7 +308,7 @@ export class Workspace implements IASTNodeLocation { // Copy the topComments list. const comments = new Array().concat(this.topComments); if (ordered && comments.length > 1) { - comments.sort(this.sortObjects_.bind(this)); + comments.sort(this.sortObjects.bind(this)); } return comments; } diff --git a/core/workspace_audio.ts b/core/workspace_audio.ts index c8d21080c..1759b30ed 100644 --- a/core/workspace_audio.ts +++ b/core/workspace_audio.ts @@ -29,7 +29,7 @@ export class WorkspaceAudio { private sounds = new Map(); /** Time that the last sound was played. */ - private lastSound_: Date | null = null; + private lastSound: Date | null = null; /** Whether the audio is muted or not. */ private muted: boolean = false; @@ -132,12 +132,12 @@ export class WorkspaceAudio { // Don't play one sound on top of another. const now = new Date(); if ( - this.lastSound_ !== null && - now.getTime() - this.lastSound_.getTime() < SOUND_LIMIT + this.lastSound !== null && + now.getTime() - this.lastSound.getTime() < SOUND_LIMIT ) { return; } - this.lastSound_ = now; + this.lastSound = now; let mySound; if (userAgent.IPAD || userAgent.ANDROID) { // Creating a new audio node causes lag in Android and iPad. Android diff --git a/core/workspace_dragger.ts b/core/workspace_dragger.ts index b9318b6d5..7ad5651f7 100644 --- a/core/workspace_dragger.ts +++ b/core/workspace_dragger.ts @@ -21,17 +21,17 @@ import type {WorkspaceSvg} from './workspace_svg.js'; * */ export class WorkspaceDragger { - private readonly horizontalScrollEnabled_: boolean; - private readonly verticalScrollEnabled_: boolean; + private readonly horizontalScrollEnabled: boolean; + private readonly verticalScrollEnabled: boolean; protected startScrollXY_: Coordinate; /** @param workspace The workspace to drag. */ constructor(private workspace: WorkspaceSvg) { /** Whether horizontal scroll is enabled. */ - this.horizontalScrollEnabled_ = this.workspace.isMovableHorizontally(); + this.horizontalScrollEnabled = this.workspace.isMovableHorizontally(); /** Whether vertical scroll is enabled. */ - this.verticalScrollEnabled_ = this.workspace.isMovableVertically(); + this.verticalScrollEnabled = this.workspace.isMovableVertically(); /** * The scroll position of the workspace at the beginning of the drag. @@ -84,11 +84,11 @@ export class WorkspaceDragger { drag(currentDragDeltaXY: Coordinate) { const newXY = Coordinate.sum(this.startScrollXY_, currentDragDeltaXY); - if (this.horizontalScrollEnabled_ && this.verticalScrollEnabled_) { + if (this.horizontalScrollEnabled && this.verticalScrollEnabled) { this.workspace.scroll(newXY.x, newXY.y); - } else if (this.horizontalScrollEnabled_) { + } else if (this.horizontalScrollEnabled) { this.workspace.scroll(newXY.x, this.workspace.scrollY); - } else if (this.verticalScrollEnabled_) { + } else if (this.verticalScrollEnabled) { this.workspace.scroll(this.workspace.scrollX, newXY.y); } else { throw new TypeError('Invalid state.'); diff --git a/core/workspace_svg.ts b/core/workspace_svg.ts index fed5e3cb1..faebcda97 100644 --- a/core/workspace_svg.ts +++ b/core/workspace_svg.ts @@ -104,7 +104,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { * Whether the workspace is visible. False if the workspace has been hidden * by calling `setVisible(false)`. */ - private isVisible_ = true; + private visible = true; /** * Whether this workspace has resizes enabled. @@ -209,7 +209,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { * Category-based toolbox providing blocks which may be dragged into this * workspace. */ - private toolbox_: IToolbox | null = null; + private toolbox: IToolbox | null = null; /** * The current gesture in progress on this workspace, if any. @@ -340,7 +340,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** Translates the workspace. */ this.setMetrics = - options.setMetrics || WorkspaceSvg.setTopLevelWorkspaceMetrics_; + options.setMetrics || WorkspaceSvg.setTopLevelWorkspaceMetrics; this.componentManager = new ComponentManager(); @@ -540,14 +540,14 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { } // Update all blocks in workspace that have a style name. - this.updateBlockStyles_( + this.updateBlockStyles( this.getAllBlocks(false).filter((block) => !!block.getStyleName()), ); // Update current toolbox selection. this.refreshToolboxSelection(); - if (this.toolbox_) { - this.toolbox_.refreshTheme(); + if (this.toolbox) { + this.toolbox.refreshTheme(); } // Re-render if workspace is visible @@ -567,7 +567,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { * * @param blocks List of blocks to update the style on. */ - private updateBlockStyles_(blocks: Block[]) { + private updateBlockStyles(blocks: Block[]) { for (let i = 0, block; (block = blocks[i]); i++) { const blockStyleName = block.getStyleName(); if (blockStyleName) { @@ -608,7 +608,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { * False if the workspace has been hidden by calling `setVisible(false)`. */ isVisible(): boolean { - return this.isVisible_; + return this.visible; } /** @@ -781,7 +781,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { this.svgGroup_, 'pointerdown', this, - this.onMouseDown_, + this.onMouseDown, false, ); // This no-op works around https://bugs.webkit.org/show_bug.cgi?id=226683, @@ -793,7 +793,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { this.svgGroup_, 'wheel', this, - this.onMouseWheel_, + this.onMouseWheel, ); } @@ -805,7 +805,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { this.options, true, ); - this.toolbox_ = new ToolboxClass!(this); + this.toolbox = new ToolboxClass!(this); } if (this.grid) { this.grid.update(this.scale); @@ -835,9 +835,9 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { if (this.svgGroup_) { dom.removeNode(this.svgGroup_); } - if (this.toolbox_) { - this.toolbox_.dispose(); - this.toolbox_ = null; + if (this.toolbox) { + this.toolbox.dispose(); + this.toolbox = null; } if (this.flyout) { this.flyout.dispose(); @@ -994,8 +994,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { if (this.flyout || opt_own) { return this.flyout; } - if (this.toolbox_) { - return this.toolbox_.getFlyout(); + if (this.toolbox) { + return this.toolbox.getFlyout(); } return null; } @@ -1006,14 +1006,14 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { * @returns The toolbox on this workspace. */ getToolbox(): IToolbox | null { - return this.toolbox_; + return this.toolbox; } /** * Update items that use screen coordinate calculations * because something has changed (e.g. scroll position, window size). */ - private updateScreenCalculations_() { + private updateScreenCalculations() { this.updateInverseScreenCTM(); this.recordDragTargets(); } @@ -1043,8 +1043,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { * trash, zoom, toolbox, etc. (e.g. window resize). */ resize() { - if (this.toolbox_) { - this.toolbox_.position(); + if (this.toolbox) { + this.toolbox.position(); } if (this.flyout) { this.flyout.position(); @@ -1067,7 +1067,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { if (this.scrollbar) { this.scrollbar.resize(); } - this.updateScreenCalculations_(); + this.updateScreenCalculations(); } /** @@ -1081,7 +1081,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { const currScroll = svgMath.getDocumentScroll(); if (!Coordinate.equals(this.lastRecordedPageScroll, currScroll)) { this.lastRecordedPageScroll = currScroll; - this.updateScreenCalculations_(); + this.updateScreenCalculations(); } } /* eslint-enable indent */ @@ -1223,7 +1223,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { * @param isVisible True if workspace should be visible. */ setVisible(isVisible: boolean) { - this.isVisible_ = isVisible; + this.visible = isVisible; if (!this.svgGroup_) { return; } @@ -1241,9 +1241,9 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { } this.getParentSvg().style.display = isVisible ? 'block' : 'none'; - if (this.toolbox_) { + if (this.toolbox) { // Currently does not support toolboxes in mutators. - this.toolbox_.setVisible(isVisible); + this.toolbox.setVisible(isVisible); } if (!isVisible) { this.hideChaff(true); @@ -1310,8 +1310,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { */ refreshToolboxSelection() { const ws = this.isFlyout ? this.targetWorkspace : this; - if (ws && !ws.currentGesture_ && ws.toolbox_ && ws.toolbox_.getFlyout()) { - ws.toolbox_.refreshSelection(); + if (ws && !ws.currentGesture_ && ws.toolbox && ws.toolbox.getFlyout()) { + ws.toolbox.refreshSelection(); } } @@ -1431,7 +1431,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { * * @param e Pointer down event. */ - private onMouseDown_(e: PointerEvent) { + private onMouseDown(e: PointerEvent) { const gesture = this.getGesture(e); if (gesture) { gesture.handleWsStart(e, this); @@ -1530,7 +1530,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { * * @param e Mouse wheel event. */ - private onMouseWheel_(e: WheelEvent) { + private onMouseWheel(e: WheelEvent) { // Don't scroll or zoom anything if drag is in progress. if (Gesture.inProgress()) { e.preventDefault(); @@ -1724,11 +1724,11 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { } if (toolbox.hasCategories(parsedToolboxDef)) { - if (!this.toolbox_) { + if (!this.toolbox) { throw Error("Existing toolbox has no categories. Can't change mode."); } this.options.languageTree = parsedToolboxDef; - this.toolbox_.render(parsedToolboxDef); + this.toolbox.render(parsedToolboxDef); } else { if (!this.flyout) { throw Error("Existing toolbox has categories. Can't change mode."); @@ -2419,7 +2419,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { * @param xyRatio Contains an x and/or y property which is a float between 0 * and 1 specifying the degree of scrolling. */ - private static setTopLevelWorkspaceMetrics_( + private static setTopLevelWorkspaceMetrics( this: WorkspaceSvg, xyRatio: {x?: number; y?: number}, ) { diff --git a/tests/mocha/block_json_test.js b/tests/mocha/block_json_test.js index 6f286fa30..4baccef6b 100644 --- a/tests/mocha/block_json_test.js +++ b/tests/mocha/block_json_test.js @@ -21,25 +21,25 @@ suite('Block JSON initialization', function () { sharedTestTeardown.call(this); }); - suite('validateTokens_', function () { + suite('validateTokens', function () { setup(function () { this.assertError = function (tokens, count, error) { const block = { type: 'test', - validateTokens_: Blockly.Block.prototype.validateTokens_, + validateTokens: Blockly.Block.prototype.validateTokens, }; assert.throws(function () { - block.validateTokens_(tokens, count); + block.validateTokens(tokens, count); }, error); }; this.assertNoError = function (tokens, count) { const block = { type: 'test', - validateTokens_: Blockly.Block.prototype.validateTokens_, + validateTokens: Blockly.Block.prototype.validateTokens, }; assert.doesNotThrow(function () { - block.validateTokens_(tokens, count); + block.validateTokens(tokens, count); }); }; }); @@ -97,17 +97,17 @@ suite('Block JSON initialization', function () { }); }); - suite('interpolateArguments_', function () { + suite('interpolateArguments', function () { setup(function () { this.assertInterpolation = function (tokens, args, lastAlign, elements) { const block = { type: 'test', - interpolateArguments_: Blockly.Block.prototype.interpolateArguments_, - stringToFieldJson_: Blockly.Block.prototype.stringToFieldJson_, - isInputKeyword_: Blockly.Block.prototype.isInputKeyword_, + interpolateArguments: Blockly.Block.prototype.interpolateArguments, + stringToFieldJson: Blockly.Block.prototype.stringToFieldJson, + isInputKeyword: Blockly.Block.prototype.isInputKeyword, }; assert.deepEqual( - block.interpolateArguments_(tokens, args, lastAlign), + block.interpolateArguments(tokens, args, lastAlign), elements, ); }; @@ -381,7 +381,7 @@ suite('Block JSON initialization', function () { }); }); - suite('fieldFromJson_', function () { + suite('fieldFromJson', function () { setup(function () { this.stub = sinon .stub(Blockly.fieldRegistry.TEST_ONLY, 'fromJsonInternal') @@ -403,10 +403,10 @@ suite('Block JSON initialization', function () { this.assertField = function (json, expectedType) { const block = { type: 'test', - fieldFromJson_: Blockly.Block.prototype.fieldFromJson_, - stringToFieldJson_: Blockly.Block.prototype.stringToFieldJson_, + fieldFromJson: Blockly.Block.prototype.fieldFromJson, + stringToFieldJson: Blockly.Block.prototype.stringToFieldJson, }; - assert.strictEqual(block.fieldFromJson_(json), expectedType); + assert.strictEqual(block.fieldFromJson(json), expectedType); }; }); @@ -563,7 +563,7 @@ suite('Block JSON initialization', function () { }); }); - suite('inputFromJson_', function () { + suite('inputFromJson', function () { setup(function () { this.assertInput = function (json, type, check, align) { const block = this.workspace.newBlock('test_basic_empty'); @@ -571,7 +571,7 @@ suite('Block JSON initialization', function () { sinon.spy(block, 'appendValueInput'); sinon.spy(block, 'appendStatementInput'); - const input = block.inputFromJson_(json); + const input = block.inputFromJson(json); switch (type) { case 'input_dummy': assert.isTrue( @@ -667,7 +667,7 @@ suite('Block JSON initialization', function () { CustomInput, ); const block = this.workspace.newBlock('test_basic_empty'); - block.inputFromJson_({'type': 'custom'}); + block.inputFromJson({'type': 'custom'}); assert.instanceOf( block.inputList[0], CustomInput, diff --git a/tests/mocha/block_test.js b/tests/mocha/block_test.js index 3f0eba44b..a489fb3e3 100644 --- a/tests/mocha/block_test.js +++ b/tests/mocha/block_test.js @@ -2527,12 +2527,12 @@ suite('Blocks', function () { this.block.setColour('20'); assert.equal(this.block.getColour(), '#a5745b'); assert.equal(this.block.colour_, this.block.getColour()); - assert.equal(this.block.hue_, '20'); + assert.equal(this.block.getHue(), '20'); }); test('Set style', function () { this.block.setStyle('styleOne'); assert.equal(this.block.getStyleName(), 'styleOne'); - assert.isNull(this.block.hue_); + assert.isNull(this.block.getHue()); // Calling setStyle does not update the colour on a headless block. assert.equal(this.block.getColour(), '#000000'); }); @@ -2566,14 +2566,14 @@ suite('Blocks', function () { assert.equal(this.block.getStyleName(), 'auto_#a5745b'); assert.equal(this.block.getColour(), '#a5745b'); assert.equal(this.block.colour_, this.block.getColour()); - assert.equal(this.block.hue_, '20'); + assert.equal(this.block.getHue(), '20'); }); test('Set colour hex', function () { this.block.setColour('#000000'); assert.equal(this.block.getStyleName(), 'auto_#000000'); assert.equal(this.block.getColour(), '#000000'); assert.equal(this.block.colour_, this.block.getColour()); - assert.isNull(this.block.hue_); + assert.isNull(this.block.getHue()); }); test('Set style', function () { this.block.setStyle('styleOne'); diff --git a/tests/mocha/blocks/logic_ternary_test.js b/tests/mocha/blocks/logic_ternary_test.js index e6e3326ec..719209359 100644 --- a/tests/mocha/blocks/logic_ternary_test.js +++ b/tests/mocha/blocks/logic_ternary_test.js @@ -38,7 +38,7 @@ suite('Logic ternary', function () { const checkList = ifInput.connection.getCheck(); assert.equal(checkList.length, 1); assert.equal(checkList[0], 'Boolean'); - assert.exists(block.onchangeWrapper_, 'Has onchange handler'); + assert.exists(block.onchangeWrapper, 'Has onchange handler'); if (inputsInline) { assert.isTrue(block.inputsInline); } else { diff --git a/tests/mocha/blocks/procedures_test.js b/tests/mocha/blocks/procedures_test.js index 84dbf1746..4b20662cf 100644 --- a/tests/mocha/blocks/procedures_test.js +++ b/tests/mocha/blocks/procedures_test.js @@ -1622,7 +1622,7 @@ suite('Procedures', function () { ); defInput.htmlInput_.value = 'proc name2'; - defInput.onHtmlInputChange_(null); + defInput.onHtmlInputChange(null); assert.equal(this.defBlock.getFieldValue('NAME'), 'proc name2'); assert.equal(this.callBlock.getFieldValue('NAME'), 'proc name2'); }); @@ -1635,7 +1635,7 @@ suite('Procedures', function () { ); defInput.htmlInput_.value = 'PROC NAME'; - defInput.onHtmlInputChange_(null); + defInput.onHtmlInputChange(null); assert.equal(this.defBlock.getFieldValue('NAME'), 'PROC NAME'); assert.equal(this.callBlock.getFieldValue('NAME'), 'PROC NAME'); }); @@ -1650,7 +1650,7 @@ suite('Procedures', function () { ); defInput.htmlInput_.value = 'proc name'; - defInput.onHtmlInputChange_(null); + defInput.onHtmlInputChange(null); assert.equal(this.defBlock.getFieldValue('NAME'), 'proc name'); assert.equal(this.callBlock.getFieldValue('NAME'), 'proc name'); }); @@ -1663,7 +1663,7 @@ suite('Procedures', function () { ); defInput.htmlInput_.value = 'proc name '; - defInput.onHtmlInputChange_(null); + defInput.onHtmlInputChange(null); assert.equal(this.defBlock.getFieldValue('NAME'), 'proc name'); assert.equal(this.callBlock.getFieldValue('NAME'), 'proc name'); }); @@ -1676,9 +1676,9 @@ suite('Procedures', function () { ); defInput.htmlInput_.value = 'proc name '; - defInput.onHtmlInputChange_(null); + defInput.onHtmlInputChange(null); defInput.htmlInput_.value = 'proc name 2'; - defInput.onHtmlInputChange_(null); + defInput.onHtmlInputChange(null); assert.equal(this.defBlock.getFieldValue('NAME'), 'proc name 2'); assert.equal(this.callBlock.getFieldValue('NAME'), 'proc name 2'); }); @@ -1691,7 +1691,7 @@ suite('Procedures', function () { ); defInput.htmlInput_.value = ''; - defInput.onHtmlInputChange_(null); + defInput.onHtmlInputChange(null); assert.equal( this.defBlock.getFieldValue('NAME'), Blockly.Msg['UNNAMED_KEY'], @@ -1710,7 +1710,7 @@ suite('Procedures', function () { ); defInput.htmlInput_.value = ''; - defInput.onHtmlInputChange_(null); + defInput.onHtmlInputChange(null); const newDefBlock = this.workspace.newBlock(testSuite.defType); newDefBlock.setFieldValue('new name', 'NAME'); assert.equal( diff --git a/tests/mocha/event_test.js b/tests/mocha/event_test.js index 2669cc854..84ea7f0d7 100644 --- a/tests/mocha/event_test.js +++ b/tests/mocha/event_test.js @@ -201,7 +201,7 @@ suite('Events', function () { suite('Block Move', function () { test('by coordinate', function () { const coordinate = new Blockly.utils.Coordinate(3, 4); - this.block.xy_ = coordinate; + this.block.xy = coordinate; const event = new Blockly.Events.BlockMove(this.block); sinon.assert.calledOnce(this.genUidStub); @@ -224,7 +224,7 @@ suite('Events', function () { try { this.parentBlock = createSimpleTestBlock(this.workspace); this.block.parentBlock_ = this.parentBlock; - this.block.xy_ = new Blockly.utils.Coordinate(3, 4); + this.block.xy = new Blockly.utils.Coordinate(3, 4); const event = new Blockly.Events.BlockMove(this.block); sinon.assert.calledTwice(this.genUidStub); assertEventEquals( @@ -331,7 +331,7 @@ suite('Events', function () { try { this.parentBlock = createSimpleTestBlock(this.workspace); this.block.parentBlock_ = this.parentBlock; - this.block.xy_ = new Blockly.utils.Coordinate(3, 4); + this.block.xy = new Blockly.utils.Coordinate(3, 4); const event = new Blockly.Events.BlockMove(this.block); sinon.assert.calledTwice(this.genUidStub); assertEventEquals( @@ -1284,7 +1284,7 @@ suite('Events', function () { suite('Filters', function () { function addMoveEvent(events, block, newX, newY) { events.push(new Blockly.Events.BlockMove(block)); - block.xy_ = new Blockly.utils.Coordinate(newX, newY); + block.xy = new Blockly.utils.Coordinate(newX, newY); events[events.length - 1].recordNew(); } diff --git a/tests/mocha/field_number_test.js b/tests/mocha/field_number_test.js index 3e0d8ca38..768766bf0 100644 --- a/tests/mocha/field_number_test.js +++ b/tests/mocha/field_number_test.js @@ -303,7 +303,7 @@ suite('Number Fields', function () { test('When Editing', function () { this.field.isBeingEdited_ = true; this.field.htmlInput_.value = String(suiteInfo.value); - this.field.onHtmlInputChange_(null); + this.field.onHtmlInputChange(null); assertFieldValue( this.field, suiteInfo.expectedValue, diff --git a/tests/mocha/field_test.js b/tests/mocha/field_test.js index 70970b9bf..38f9662d6 100644 --- a/tests/mocha/field_test.js +++ b/tests/mocha/field_test.js @@ -626,7 +626,7 @@ suite('Abstract Fields', function () { const field = new Blockly.Field('value', null, { tooltip: 'test tooltip', }); - assert.equal(field.tooltip_, 'test tooltip'); + assert.equal(field.getTooltip(), 'test tooltip'); }); test('JS Constructor - Dynamic', function () { const returnTooltip = function () { @@ -635,13 +635,13 @@ suite('Abstract Fields', function () { const field = new Blockly.Field('value', null, { tooltip: returnTooltip, }); - assert.equal(field.tooltip_, returnTooltip); + assert.equal(field.getTooltip(), returnTooltip()); }); test('JSON Definition', function () { const field = CustomField.fromJson({ tooltip: 'test tooltip', }); - assert.equal(field.tooltip_, 'test tooltip'); + assert.equal(field.getTooltip(), 'test tooltip'); }); suite('W/ Msg References', function () { setup(function () { @@ -652,13 +652,13 @@ suite('Abstract Fields', function () { const field = new Blockly.Field('value', null, { tooltip: '%{BKY_TOOLTIP}', }); - assert.equal(field.tooltip_, 'test tooltip'); + assert.equal(field.getTooltip(), 'test tooltip'); }); test('JSON Definition', function () { const field = CustomField.fromJson({ tooltip: '%{BKY_TOOLTIP}', }); - assert.equal(field.tooltip_, 'test tooltip'); + assert.equal(field.getTooltip(), 'test tooltip'); }); }); suite('setTooltip', function () { diff --git a/tests/mocha/field_textinput_test.js b/tests/mocha/field_textinput_test.js index 3b755a543..7170b27ff 100644 --- a/tests/mocha/field_textinput_test.js +++ b/tests/mocha/field_textinput_test.js @@ -172,7 +172,7 @@ suite('Text Input Fields', function () { test('When Editing', function () { this.field.isBeingEdited_ = true; this.field.htmlInput_.value = suiteInfo.value; - this.field.onHtmlInputChange_(null); + this.field.onHtmlInputChange(null); assertFieldValue( this.field, suiteInfo.expectedValue, diff --git a/tests/mocha/keydown_test.js b/tests/mocha/keydown_test.js index da8129b48..0b72a7fee 100644 --- a/tests/mocha/keydown_test.js +++ b/tests/mocha/keydown_test.js @@ -68,7 +68,7 @@ suite('Key Down', function () { sinon.assert.notCalled(this.hideChaffSpy); }); test('Not called on hidden workspaces', function () { - this.workspace.isVisible_ = false; + this.workspace.visible = false; this.injectionDiv.dispatchEvent(this.event); sinon.assert.notCalled(this.hideChaffSpy); }); diff --git a/tests/mocha/shortcut_registry_test.js b/tests/mocha/shortcut_registry_test.js index cfd98a302..37c1b9c20 100644 --- a/tests/mocha/shortcut_registry_test.js +++ b/tests/mocha/shortcut_registry_test.js @@ -414,19 +414,19 @@ suite('Keyboard Shortcut Registry Test', function () { suite('serializeKeyEvent', function () { test('Serialize key', function () { const mockEvent = createKeyDownEvent(Blockly.utils.KeyCodes.A); - const serializedKey = this.registry.serializeKeyEvent_(mockEvent); + const serializedKey = this.registry.serializeKeyEvent(mockEvent); assert.equal(serializedKey, '65'); }); test('Serialize key code and modifier', function () { const mockEvent = createKeyDownEvent(Blockly.utils.KeyCodes.A, [ Blockly.utils.KeyCodes.CTRL, ]); - const serializedKey = this.registry.serializeKeyEvent_(mockEvent); + const serializedKey = this.registry.serializeKeyEvent(mockEvent); assert.equal(serializedKey, 'Control+65'); }); test('Serialize only a modifier', function () { const mockEvent = createKeyDownEvent(null, [Blockly.utils.KeyCodes.CTRL]); - const serializedKey = this.registry.serializeKeyEvent_(mockEvent); + const serializedKey = this.registry.serializeKeyEvent(mockEvent); assert.equal(serializedKey, 'Control'); }); test('Serialize multiple modifiers', function () { @@ -434,7 +434,7 @@ suite('Keyboard Shortcut Registry Test', function () { Blockly.utils.KeyCodes.CTRL, Blockly.utils.KeyCodes.SHIFT, ]); - const serializedKey = this.registry.serializeKeyEvent_(mockEvent); + const serializedKey = this.registry.serializeKeyEvent(mockEvent); assert.equal(serializedKey, 'Shift+Control'); }); test('Throw error when incorrect modifier', function () { diff --git a/tests/mocha/test_helpers/toolbox_definitions.js b/tests/mocha/test_helpers/toolbox_definitions.js index 2f767ed60..427331bcf 100644 --- a/tests/mocha/test_helpers/toolbox_definitions.js +++ b/tests/mocha/test_helpers/toolbox_definitions.js @@ -238,7 +238,7 @@ export function getBasicToolbox() { const workspace = new Blockly.WorkspaceSvg(new Blockly.Options({})); const toolbox = new Blockly.Toolbox(workspace); toolbox.HtmlDiv = document.createElement('div'); - toolbox.flyout_ = sinon.createStubInstance(Blockly.VerticalFlyout); + toolbox.flyout = sinon.createStubInstance(Blockly.VerticalFlyout); return toolbox; } diff --git a/tests/mocha/toolbox_test.js b/tests/mocha/toolbox_test.js index b723e7038..70f5ff8f9 100644 --- a/tests/mocha/toolbox_test.js +++ b/tests/mocha/toolbox_test.js @@ -82,7 +82,7 @@ suite('Toolbox', function () { const componentManager = this.toolbox.workspace_.getComponentManager(); sinon.stub(componentManager, 'addComponent'); this.toolbox.init(); - assert.isDefined(this.toolbox.flyout_); + assert.isDefined(this.toolbox.getFlyout()); }); }); @@ -239,30 +239,30 @@ suite('Toolbox', function () { sinon.assert.called(preventDefaultEvent); } - test('Down button is pushed -> Should call selectNext_', function () { - testCorrectFunctionCalled(this.toolbox, 'ArrowDown', 'selectNext_', true); + test('Down button is pushed -> Should call selectNext', function () { + testCorrectFunctionCalled(this.toolbox, 'ArrowDown', 'selectNext', true); }); - test('Up button is pushed -> Should call selectPrevious_', function () { + test('Up button is pushed -> Should call selectPrevious', function () { testCorrectFunctionCalled( this.toolbox, 'ArrowUp', - 'selectPrevious_', + 'selectPrevious', true, ); }); - test('Left button is pushed -> Should call selectParent_', function () { + test('Left button is pushed -> Should call selectParent', function () { testCorrectFunctionCalled( this.toolbox, 'ArrowLeft', - 'selectParent_', + 'selectParent', true, ); }); - test('Right button is pushed -> Should call selectChild_', function () { + test('Right button is pushed -> Should call selectChild', function () { testCorrectFunctionCalled( this.toolbox, 'ArrowRight', - 'selectChild_', + 'selectChild', true, ); }); @@ -295,21 +295,21 @@ suite('Toolbox', function () { this.toolbox.dispose(); }); - suite('selectChild_', function () { + suite('selectChild', function () { test('No item is selected -> Should not handle event', function () { this.toolbox.selectedItem_ = null; - const handled = this.toolbox.selectChild_(); + const handled = this.toolbox.selectChild(); assert.isFalse(handled); }); test('Selected item is not collapsible -> Should not handle event', function () { this.toolbox.selectedItem_ = getNonCollapsibleItem(this.toolbox); - const handled = this.toolbox.selectChild_(); + const handled = this.toolbox.selectChild(); assert.isFalse(handled); }); test('Selected item is collapsible -> Should expand', function () { const collapsibleItem = getCollapsibleItem(this.toolbox); this.toolbox.selectedItem_ = collapsibleItem; - const handled = this.toolbox.selectChild_(); + const handled = this.toolbox.selectChild(); assert.isTrue(handled); assert.isTrue(collapsibleItem.isExpanded()); assert.equal(this.toolbox.selectedItem_, collapsibleItem); @@ -318,25 +318,25 @@ suite('Toolbox', function () { test('Selected item is expanded -> Should select child', function () { const collapsibleItem = getCollapsibleItem(this.toolbox); collapsibleItem.expanded_ = true; - const selectNextStub = sinon.stub(this.toolbox, 'selectNext_'); + const selectNextStub = sinon.stub(this.toolbox, 'selectNext'); this.toolbox.selectedItem_ = collapsibleItem; - const handled = this.toolbox.selectChild_(); + const handled = this.toolbox.selectChild(); assert.isTrue(handled); sinon.assert.called(selectNextStub); }); }); - suite('selectParent_', function () { + suite('selectParent', function () { test('No item selected -> Should not handle event', function () { this.toolbox.selectedItem_ = null; - const handled = this.toolbox.selectParent_(); + const handled = this.toolbox.selectParent(); assert.isFalse(handled); }); test('Selected item is expanded -> Should collapse', function () { const collapsibleItem = getCollapsibleItem(this.toolbox); collapsibleItem.expanded_ = true; this.toolbox.selectedItem_ = collapsibleItem; - const handled = this.toolbox.selectParent_(); + const handled = this.toolbox.selectParent(); assert.isTrue(handled); assert.isFalse(collapsibleItem.isExpanded()); assert.equal(this.toolbox.selectedItem_, collapsibleItem); @@ -344,29 +344,29 @@ suite('Toolbox', function () { test('Selected item is not expanded -> Should get parent', function () { const childItem = getChildItem(this.toolbox); this.toolbox.selectedItem_ = childItem; - const handled = this.toolbox.selectParent_(); + const handled = this.toolbox.selectParent(); assert.isTrue(handled); assert.equal(this.toolbox.selectedItem_, childItem.getParent()); }); }); - suite('selectNext_', function () { + suite('selectNext', function () { test('No item is selected -> Should not handle event', function () { this.toolbox.selectedItem_ = null; - const handled = this.toolbox.selectNext_(); + const handled = this.toolbox.selectNext(); assert.isFalse(handled); }); test('Next item is selectable -> Should select next item', function () { const item = this.toolbox.contents_[0]; this.toolbox.selectedItem_ = item; - const handled = this.toolbox.selectNext_(); + const handled = this.toolbox.selectNext(); assert.isTrue(handled); assert.equal(this.toolbox.selectedItem_, this.toolbox.contents_[1]); }); test('Selected item is last item -> Should not handle event', function () { const item = this.toolbox.contents_[this.toolbox.contents_.length - 1]; this.toolbox.selectedItem_ = item; - const handled = this.toolbox.selectNext_(); + const handled = this.toolbox.selectNext(); assert.isFalse(handled); assert.equal(this.toolbox.selectedItem_, item); }); @@ -375,7 +375,7 @@ suite('Toolbox', function () { const childItem = item.flyoutItems_[0]; item.expanded_ = false; this.toolbox.selectedItem_ = item; - const handled = this.toolbox.selectNext_(); + const handled = this.toolbox.selectNext(); assert.isTrue(handled); assert.notEqual(this.toolbox.selectedItem_, childItem); }); @@ -384,13 +384,13 @@ suite('Toolbox', function () { suite('selectPrevious', function () { test('No item is selected -> Should not handle event', function () { this.toolbox.selectedItem_ = null; - const handled = this.toolbox.selectPrevious_(); + const handled = this.toolbox.selectPrevious(); assert.isFalse(handled); }); test('Selected item is first item -> Should not handle event', function () { const item = this.toolbox.contents_[0]; this.toolbox.selectedItem_ = item; - const handled = this.toolbox.selectPrevious_(); + const handled = this.toolbox.selectPrevious(); assert.isFalse(handled); assert.equal(this.toolbox.selectedItem_, item); }); @@ -398,7 +398,7 @@ suite('Toolbox', function () { const item = this.toolbox.contents_[1]; const prevItem = this.toolbox.contents_[0]; this.toolbox.selectedItem_ = item; - const handled = this.toolbox.selectPrevious_(); + const handled = this.toolbox.selectPrevious(); assert.isTrue(handled); assert.equal(this.toolbox.selectedItem_, prevItem); }); @@ -409,7 +409,7 @@ suite('Toolbox', function () { // Gets the item after the parent. const item = this.toolbox.contents_[parentIdx + 1]; this.toolbox.selectedItem_ = item; - const handled = this.toolbox.selectPrevious_(); + const handled = this.toolbox.selectPrevious(); assert.isTrue(handled); assert.notEqual(this.toolbox.selectedItem_, childItem); }); @@ -477,7 +477,7 @@ suite('Toolbox', function () { }); function testHideFlyout(toolbox, oldItem, newItem) { - const updateFlyoutStub = sinon.stub(toolbox.flyout_, 'hide'); + const updateFlyoutStub = sinon.stub(toolbox.getFlyout(), 'hide'); toolbox.updateFlyout_(oldItem, newItem); sinon.assert.called(updateFlyoutStub); } @@ -498,9 +498,9 @@ suite('Toolbox', function () { testHideFlyout(this.toolbox, null, newItem); }); test('Select selectable item -> Should open flyout', function () { - const showFlyoutstub = sinon.stub(this.toolbox.flyout_, 'show'); + const showFlyoutstub = sinon.stub(this.toolbox.getFlyout(), 'show'); const scrollToStartFlyout = sinon.stub( - this.toolbox.flyout_, + this.toolbox.getFlyout(), 'scrollToStart', ); const newItem = getNonCollapsibleItem(this.toolbox); @@ -534,14 +534,14 @@ suite('Toolbox', function () { test('HtmlDiv is not created -> Should not resize', function () { const toolbox = this.toolbox; toolbox.HtmlDiv = null; - toolbox.horizontalLayout_ = true; + toolbox.horizontalLayout = true; toolbox.position(); assert.equal(toolbox.height_, 0); }); test('Horizontal toolbox at top -> Should anchor horizontal toolbox to top', function () { const toolbox = this.toolbox; toolbox.toolboxPosition = Blockly.utils.toolbox.Position.TOP; - toolbox.horizontalLayout_ = true; + toolbox.horizontalLayout = true; toolbox.position(); checkHorizontalToolbox(toolbox); assert.equal(toolbox.HtmlDiv.style.top, '0px', 'Check top'); @@ -549,7 +549,7 @@ suite('Toolbox', function () { test('Horizontal toolbox at bottom -> Should anchor horizontal toolbox to bottom', function () { const toolbox = this.toolbox; toolbox.toolboxPosition = Blockly.utils.toolbox.Position.BOTTOM; - toolbox.horizontalLayout_ = true; + toolbox.horizontalLayout = true; toolbox.position(); checkHorizontalToolbox(toolbox); assert.equal(toolbox.HtmlDiv.style.bottom, '0px', 'Check bottom'); @@ -557,7 +557,7 @@ suite('Toolbox', function () { test('Vertical toolbox at right -> Should anchor to right', function () { const toolbox = this.toolbox; toolbox.toolboxPosition = Blockly.utils.toolbox.Position.RIGHT; - toolbox.horizontalLayout_ = false; + toolbox.horizontalLayout = false; toolbox.position(); assert.equal(toolbox.HtmlDiv.style.right, '0px', 'Check right'); checkVerticalToolbox(toolbox); @@ -565,7 +565,7 @@ suite('Toolbox', function () { test('Vertical toolbox at left -> Should anchor to left', function () { const toolbox = this.toolbox; toolbox.toolboxPosition = Blockly.utils.toolbox.Position.LEFT; - toolbox.horizontalLayout_ = false; + toolbox.horizontalLayout = false; toolbox.position(); assert.equal(toolbox.HtmlDiv.style.left, '0px', 'Check left'); checkVerticalToolbox(toolbox); diff --git a/tests/mocha/variable_model_test.js b/tests/mocha/variable_model_test.js index 207c580de..4ac533b65 100644 --- a/tests/mocha/variable_model_test.js +++ b/tests/mocha/variable_model_test.js @@ -29,7 +29,7 @@ suite('Variable Model', function () { ); assert.equal(variable.name, 'test'); assert.equal(variable.type, 'test_type'); - assert.equal(variable.id_, 'test_id'); + assert.equal(variable.getId(), 'test_id'); }); test('Null type', function () { @@ -61,7 +61,7 @@ suite('Variable Model', function () { ); assert.equal(variable.name, 'test'); assert.equal(variable.type, 'test_type'); - assert.exists(variable.id_); + assert.exists(variable.getId()); }); test('Undefined id', function () { @@ -73,13 +73,13 @@ suite('Variable Model', function () { ); assert.equal(variable.name, 'test'); assert.equal(variable.type, 'test_type'); - assert.exists(variable.id_); + assert.exists(variable.getId()); }); test('Only name provided', function () { const variable = new Blockly.VariableModel(this.workspace, 'test'); assert.equal(variable.name, 'test'); assert.equal(variable.type, ''); - assert.exists(variable.id_); + assert.exists(variable.getId()); }); }); diff --git a/tests/mocha/workspace_svg_test.js b/tests/mocha/workspace_svg_test.js index 75c0625fb..8282e7ac2 100644 --- a/tests/mocha/workspace_svg_test.js +++ b/tests/mocha/workspace_svg_test.js @@ -136,7 +136,7 @@ suite('WorkspaceSvg', function () { sinon .stub(Blockly.utils.toolbox.TEST_ONLY, 'hasCategoriesInternal') .returns(true); - this.workspace.toolbox_ = null; + this.workspace.toolbox = null; assert.throws( function () { this.workspace.updateToolbox({'contents': []}); From 5870c66cf07ff3caf12bddfe50d294602856bb5a Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Tue, 3 Dec 2024 12:40:48 -0800 Subject: [PATCH 81/90] chore: Migrate ESLint configuration file to new flat format. (#8675) * chore: rename .eslintrc.js to eslint.config.js * chore: Rename eslint.config.js to eslint.config.mjs. * refactor: Migrate ESLint config to new flat format. * chore: Remove old per-directory and global ignore ESLint config files. * fix: Allowlist JSDoc tag aliases. * fix: Don't require @license in tests/*. * fix: Add NodeJS globals to several files that run under Node. * chore: Remove now-unneeded ESLint directives in core. * chore: Remove invalid/unneeded ESLint directives. * fix: Fix invalid use of `await` outside of an `async` function. * fix: Improve screenshot error message. * fix: Update ESLint config file to not warn on existing violations. * chore: Remove suppressions of rules that weren't triggering. * chore: Fix package-lock.json. --- .eslintignore | 28 - .eslintrc.js | 189 ----- core/interfaces/i_serializer.ts | 1 - core/renderers/geras/constants.ts | 4 - core/renderers/zelos/constants.ts | 2 - core/serialization/blocks.ts | 4 - core/serialization/variables.ts | 1 - core/variables.ts | 1 - core/workspace_svg.ts | 2 - eslint.config.mjs | 308 ++++++++ package-lock.json | 739 ++++++++++---------- package.json | 11 +- scripts/helpers.js | 4 +- tests/.eslintrc.json | 10 - tests/browser/.eslintrc.json | 29 - tests/migration/validate-renamings.mjs | 61 +- tests/mocha/.eslintrc.json | 21 - tests/mocha/serializer_test.js | 4 - tests/mocha/test_helpers/code_generation.js | 1 - tests/mocha/workspace_test.js | 1 - tests/node/.eslintrc.json | 12 - tests/playgrounds/screenshot.js | 2 +- 22 files changed, 716 insertions(+), 719 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc.js create mode 100644 eslint.config.mjs delete mode 100644 tests/.eslintrc.json delete mode 100644 tests/browser/.eslintrc.json delete mode 100644 tests/mocha/.eslintrc.json delete mode 100644 tests/node/.eslintrc.json diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 1430463fe..000000000 --- a/.eslintignore +++ /dev/null @@ -1,28 +0,0 @@ -# Build Artifacts -/msg/* -/build/* -/dist/* -/typings/* -/docs/* - -# Tests other than mocha unit tests -/tests/blocks/* -/tests/themes/* -/tests/compile/* -/tests/jsunit/* -/tests/generators/* -/tests/mocha/webdriver.js -/tests/screenshot/* -/tests/test_runner.js -/tests/workspace_svg/* - -# Demos, scripts, misc -/node_modules/* -/generators/* -/demos/* -/appengine/* -/externs/* -/closure/* -/scripts/gulpfiles/* -CHANGELOG.md -PULL_REQUEST_TEMPLATE.md \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5b539133b..000000000 --- a/.eslintrc.js +++ /dev/null @@ -1,189 +0,0 @@ -const rules = { - 'no-unused-vars': [ - 'error', - { - 'args': 'after-used', - // Ignore vars starting with an underscore. - 'varsIgnorePattern': '^_', - // Ignore arguments starting with an underscore. - 'argsIgnorePattern': '^_', - }, - ], - // Blockly uses for exporting symbols. no-self-assign added in eslint 5. - 'no-self-assign': ['off'], - // Blockly uses single quotes except for JSON blobs, which must use double - // quotes. - 'quotes': ['off'], - // Blockly uses 'use strict' in files. - 'strict': ['off'], - // Closure style allows redeclarations. - 'no-redeclare': ['off'], - 'valid-jsdoc': ['error'], - 'no-console': ['off'], - 'spaced-comment': [ - 'error', - 'always', - { - 'block': { - 'balanced': true, - }, - 'exceptions': ['*'], - }, - ], - // Blockly uses prefixes for optional arguments and test-only functions. - 'camelcase': [ - 'error', - { - 'properties': 'never', - 'allow': ['^opt_', '^_opt_', '^testOnly_'], - }, - ], - // Blockly uses capital letters for some non-constructor namespaces. - // Keep them for legacy reasons. - 'new-cap': ['off'], - // Blockly uses objects as maps, but uses Object.create(null) to - // instantiate them. - 'guard-for-in': ['off'], - 'prefer-spread': ['off'], -}; - -/** - * Build shared settings for TS linting and add in the config differences. - * @return {Object} The override TS linting for given files and a given - * tsconfig. - */ -function buildTSOverride({files, tsconfig}) { - return { - 'files': files, - 'plugins': ['@typescript-eslint/eslint-plugin', 'jsdoc'], - 'settings': { - 'jsdoc': { - 'mode': 'typescript', - }, - }, - 'parser': '@typescript-eslint/parser', - 'parserOptions': { - 'project': tsconfig, - 'tsconfigRootDir': '.', - 'ecmaVersion': 2020, - 'sourceType': 'module', - }, - 'extends': [ - 'plugin:@typescript-eslint/recommended', - 'plugin:jsdoc/recommended', - 'prettier', // Extend again so that these rules are applied last - ], - 'rules': { - // TS rules - // Blockly uses namespaces to do declaration merging in some cases. - '@typescript-eslint/no-namespace': ['off'], - // Use the updated TypeScript-specific rule. - 'no-invalid-this': ['off'], - '@typescript-eslint/no-invalid-this': ['error'], - // Needs decision. 601 problems. - '@typescript-eslint/no-non-null-assertion': ['off'], - // Use TS-specific rule. - 'no-unused-vars': ['off'], - '@typescript-eslint/no-unused-vars': [ - 'error', - { - 'argsIgnorePattern': '^_', - 'varsIgnorePattern': '^_', - }, - ], - // Temporarily disable. 23 problems. - '@typescript-eslint/no-explicit-any': ['off'], - // Temporarily disable. 128 problems. - 'require-jsdoc': ['off'], - // Temporarily disable. 55 problems. - '@typescript-eslint/ban-types': ['off'], - // Temporarily disable. 33 problems. - '@typescript-eslint/no-empty-function': ['off'], - // Temporarily disable. 3 problems. - '@typescript-eslint/no-empty-interface': ['off'], - // We use this pattern extensively for block (e.g. controls_if) interfaces. - '@typescript-eslint/no-empty-object-type': ['off'], - - // TsDoc rules (using JsDoc plugin) - // Disable built-in jsdoc verifier. - 'valid-jsdoc': ['off'], - // Don't require types in params and returns docs. - 'jsdoc/require-param-type': ['off'], - 'jsdoc/require-returns-type': ['off'], - // params and returns docs are optional. - 'jsdoc/require-param-description': ['off'], - 'jsdoc/require-returns': ['off'], - // Disable for now (breaks on `this` which is not really a param). - 'jsdoc/require-param': ['off'], - // Don't auto-add missing jsdoc. Only required on exported items. - 'jsdoc/require-jsdoc': [ - 'warn', - { - 'enableFixer': false, - 'publicOnly': true, - }, - ], - 'jsdoc/check-tag-names': [ - 'error', - { - 'definedTags': [ - 'sealed', - 'typeParam', - 'remarks', - 'define', - 'nocollapse', - 'suppress', - ], - }, - ], - // Re-enable after Closure is removed. There shouldn't even be - // types in the TsDoc. - // These are "types" because of Closure's @suppress {warningName} - 'jsdoc/no-undefined-types': ['off'], - 'jsdoc/valid-types': ['off'], - // Disabled due to not handling `this`. If re-enabled, - // checkDestructured option - // should be left as false. - 'jsdoc/check-param-names': ['off', {'checkDestructured': false}], - // Allow any text in the license tag. Other checks are not relevant. - 'jsdoc/check-values': ['off'], - // Ensure there is a blank line between the body and any @tags, - // as required by the tsdoc spec (see #6353). - 'jsdoc/tag-lines': ['error', 'any', {'startLines': 1}], - }, - }; -} - -// NOTE: When this output is put directly in `module.exports`, the formatter -// does not align with the linter. -const eslintJSON = { - 'rules': rules, - 'env': { - 'es2020': true, - 'browser': true, - }, - 'globals': { - 'goog': true, - 'exports': true, - }, - 'extends': ['eslint:recommended', 'google', 'prettier'], - // TypeScript-specific config. Uses above rules plus these. - 'overrides': [ - buildTSOverride({ - files: ['./**/*.ts', './**/*.tsx'], - tsconfig: './tsconfig.json', - }), - buildTSOverride({ - files: ['./tests/typescript/**/*.ts', './tests/typescript/**/*.tsx'], - tsconfig: './tests/typescript/tsconfig.json', - }), - { - 'files': ['./.eslintrc.js'], - 'env': { - 'node': true, - }, - }, - ], -}; - -module.exports = eslintJSON; diff --git a/core/interfaces/i_serializer.ts b/core/interfaces/i_serializer.ts index 0e8302f39..f5fbb67d1 100644 --- a/core/interfaces/i_serializer.ts +++ b/core/interfaces/i_serializer.ts @@ -30,7 +30,6 @@ export interface ISerializer { * state to record. */ save(workspace: Workspace): object | null; - /* eslint-enable valid-jsdoc */ /** * Loads the state of the plugin or system. diff --git a/core/renderers/geras/constants.ts b/core/renderers/geras/constants.ts index fc0b7ae79..6d0c3dfbf 100644 --- a/core/renderers/geras/constants.ts +++ b/core/renderers/geras/constants.ts @@ -31,16 +31,12 @@ export class ConstantProvider extends BaseConstantProvider { override getCSS_(selector: string) { return super.getCSS_(selector).concat([ - /* eslint-disable indent */ - /* clang-format off */ // Insertion marker. `${selector} .blocklyInsertionMarker>.blocklyPathLight,`, `${selector} .blocklyInsertionMarker>.blocklyPathDark {`, `fill-opacity: ${this.INSERTION_MARKER_OPACITY};`, `stroke: none;`, '}', - /* clang-format on */ - /* eslint-enable indent */ ]); } } diff --git a/core/renderers/zelos/constants.ts b/core/renderers/zelos/constants.ts index 66ba6c958..74df72aeb 100644 --- a/core/renderers/zelos/constants.ts +++ b/core/renderers/zelos/constants.ts @@ -786,7 +786,6 @@ export class ConstantProvider extends BaseConstantProvider { override getCSS_(selector: string) { return [ - /* eslint-disable indent */ // Text. `${selector} .blocklyText,`, `${selector} .blocklyFlyoutLabelText {`, @@ -871,4 +870,3 @@ export class ConstantProvider extends BaseConstantProvider { ]; } } -/* eslint-enable indent */ diff --git a/core/serialization/blocks.ts b/core/serialization/blocks.ts index b693ff569..b90262240 100644 --- a/core/serialization/blocks.ts +++ b/core/serialization/blocks.ts @@ -32,9 +32,6 @@ import { import * as priorities from './priorities.js'; import * as serializationRegistry from './registry.js'; -// TODO(#5160): Remove this once lint is fixed. -/* eslint-disable no-use-before-define */ - /** * Represents the state of a connection. */ @@ -795,7 +792,6 @@ const saveBlock = save; export class BlockSerializer implements ISerializer { priority: number; - /* eslint-disable-next-line require-jsdoc */ constructor() { /** The priority for deserializing blocks. */ this.priority = priorities.BLOCKS; diff --git a/core/serialization/variables.ts b/core/serialization/variables.ts index b714401eb..e4fc7fbaa 100644 --- a/core/serialization/variables.ts +++ b/core/serialization/variables.ts @@ -26,7 +26,6 @@ export interface State { export class VariableSerializer implements ISerializer { priority: number; - /* eslint-disable-next-line require-jsdoc */ constructor() { /** The priority for deserializing variables. */ this.priority = priorities.VARIABLES; diff --git a/core/variables.ts b/core/variables.ts index b69893a9f..491b4c1b7 100644 --- a/core/variables.ts +++ b/core/variables.ts @@ -202,7 +202,6 @@ export function generateUniqueNameFromOptions( let letterIndex = letters.indexOf(startChar); let potName = startChar; - // eslint-disable-next-line no-constant-condition while (true) { let inUse = false; for (let i = 0; i < usedNames.length; i++) { diff --git a/core/workspace_svg.ts b/core/workspace_svg.ts index faebcda97..6acd31c9c 100644 --- a/core/workspace_svg.ts +++ b/core/workspace_svg.ts @@ -1077,14 +1077,12 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { * @internal */ updateScreenCalculationsIfScrolled() { - /* eslint-disable indent */ const currScroll = svgMath.getDocumentScroll(); if (!Coordinate.equals(this.lastRecordedPageScroll, currScroll)) { this.lastRecordedPageScroll = currScroll; this.updateScreenCalculations(); } } - /* eslint-enable indent */ /** * @returns The layer manager for this workspace. diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 000000000..68f25133f --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,308 @@ +import eslint from '@eslint/js'; +import googleStyle from 'eslint-config-google'; +import jsdoc from 'eslint-plugin-jsdoc'; +import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'; +import globals from 'globals'; +import tseslint from 'typescript-eslint'; + +// These rules are no longer supported, but the Google style package we depend +// on hasn't been updated in years to remove them, even though they have been +// removed from the repo. Manually delete them here to avoid breaking linting. +delete googleStyle.rules['valid-jsdoc']; +delete googleStyle.rules['require-jsdoc']; + +const rules = { + 'spaced-comment': [ + 'error', + 'always', + { + 'block': { + 'balanced': true, + }, + 'exceptions': ['*'], + }, + ], + // Blockly uses prefixes for optional arguments and test-only functions. + 'camelcase': [ + 'error', + { + 'properties': 'never', + 'allow': ['^opt_', '^_opt_', '^testOnly_'], + }, + ], + // Blockly uses capital letters for some non-constructor namespaces. + // Keep them for legacy reasons. + 'new-cap': ['off'], + // Blockly uses objects as maps, but uses Object.create(null) to + // instantiate them. + 'guard-for-in': ['off'], +}; + +/** + * Build shared settings for TS linting and add in the config differences. + * @param {object} root0 A configuration options struct. + * @param {!Array} root0.files List of file globs to apply rules to. + * @param {string} root0.tsconfig Path to the tsconfig.json file to use. + * @returns {object} The override TS linting for given files and a given + * tsconfig. + */ +function buildTSOverride({files, tsconfig}) { + return { + files: files, + plugins: { + '@typescript-eslint': tseslint.plugin, + jsdoc, + }, + languageOptions: { + parser: tseslint.parser, + 'ecmaVersion': 2020, + 'sourceType': 'module', + parserOptions: { + 'project': tsconfig, + 'tsconfigRootDir': '.', + }, + globals: { + ...globals.browser, + }, + }, + extends: [ + ...tseslint.configs.recommended, + jsdoc.configs['flat/recommended-typescript'], + eslintPluginPrettierRecommended, + ], + rules: { + // TS rules + // Blockly uses namespaces to do declaration merging in some cases. + '@typescript-eslint/no-namespace': ['off'], + // Use the updated TypeScript-specific rule. + 'no-invalid-this': ['off'], + '@typescript-eslint/no-invalid-this': ['error'], + '@typescript-eslint/no-unused-vars': [ + 'error', + { + 'argsIgnorePattern': '^_', + 'varsIgnorePattern': '^_', + }, + ], + // Temporarily disable. 23 problems. + '@typescript-eslint/no-explicit-any': ['off'], + // We use this pattern extensively for block (e.g. controls_if) interfaces. + '@typescript-eslint/no-empty-object-type': ['off'], + + // params and returns docs are optional. + 'jsdoc/require-param-description': ['off'], + 'jsdoc/require-returns': ['off'], + // Disable for now (breaks on `this` which is not really a param). + 'jsdoc/require-param': ['off'], + // Don't auto-add missing jsdoc. Only required on exported items. + 'jsdoc/require-jsdoc': [ + 'warn', + { + 'enableFixer': false, + 'publicOnly': true, + }, + ], + 'jsdoc/check-tag-names': [ + 'error', + { + 'definedTags': [ + 'sealed', + 'typeParam', + 'remarks', + 'define', + 'nocollapse', + ], + }, + ], + // Disabled due to not handling `this`. If re-enabled, + // checkDestructured option + // should be left as false. + 'jsdoc/check-param-names': ['off', {'checkDestructured': false}], + // Allow any text in the license tag. Other checks are not relevant. + 'jsdoc/check-values': ['off'], + // Ensure there is a blank line between the body and any @tags, + // as required by the tsdoc spec (see #6353). + 'jsdoc/tag-lines': ['error', 'any', {'startLines': 1}], + }, + }; +} + +export default [ + { + // Note: there should be no other properties in this object + ignores: [ + // Build artifacts + 'msg/*', + 'build/*', + 'dist/*', + 'typings/*', + 'docs/*', + // Tests other than mocha unit tests + 'tests/blocks/*', + 'tests/themes/*', + 'tests/compile/*', + 'tests/jsunit/*', + 'tests/generators/*', + 'tests/mocha/webdriver.js', + 'tests/screenshot/*', + 'tests/test_runner.js', + 'tests/workspace_svg/*', + // Demos, scripts, misc + 'node_modules/*', + 'generators/*', + 'demos/*', + 'appengine/*', + 'externs/*', + 'closure/*', + 'scripts/gulpfiles/*', + 'CHANGELOG.md', + 'PULL_REQUEST_TEMPLATE.md', + ], + }, + eslint.configs.recommended, + jsdoc.configs['flat/recommended'], + googleStyle, + { + languageOptions: { + ecmaVersion: 2020, + sourceType: 'module', + }, + settings: { + // Allowlist some JSDoc tag aliases we use. + 'jsdoc': { + 'tagNamePreference': { + 'return': 'return', + 'fileoverview': 'fileoverview', + 'extends': 'extends', + 'constructor': 'constructor', + }, + }, + }, + rules, + }, + { + files: [ + 'eslint.config.mjs', + '.prettierrc.js', + 'gulpfile.js', + 'scripts/helpers.js', + 'tests/mocha/.mocharc.js', + 'tests/migration/validate-renamings.mjs', + ], + languageOptions: { + globals: { + ...globals.node, + }, + }, + rules: { + 'jsdoc/check-values': ['off'], + }, + }, + { + files: ['tests/**'], + languageOptions: { + globals: { + 'Blockly': true, + 'dartGenerator': true, + 'javascriptGenerator': true, + 'luaGenerator': true, + 'phpGenerator': true, + 'pythonGenerator': true, + }, + }, + rules: { + 'jsdoc/check-values': ['off'], + 'jsdoc/require-returns': ['off'], + 'jsdoc/no-undefined-types': ['off'], + 'jsdoc/valid-types': ['off'], + 'jsdoc/check-types': ['off'], + 'jsdoc/check-tag-names': ['warn', {'definedTags': ['record']}], + 'jsdoc/tag-lines': ['off'], + 'jsdoc/no-defaults': ['off'], + }, + }, + { + files: ['tests/browser/**'], + languageOptions: { + sourceType: 'module', + globals: { + 'chai': false, + 'sinon': false, + ...globals.mocha, + ...globals.browser, + ...globals.node, + }, + }, + rules: { + // Allow uncommented helper functions in tests. + 'jsdoc/require-jsdoc': ['off'], + 'jsdoc/require-returns-type': ['off'], + 'jsdoc/require-param-type': ['off'], + 'no-invalid-this': ['off'], + }, + }, + { + files: ['tests/mocha/**'], + languageOptions: { + sourceType: 'module', + globals: { + 'chai': false, + 'sinon': false, + ...globals.mocha, + ...globals.browser, + }, + }, + rules: { + 'no-unused-vars': ['off'], + // Allow uncommented helper functions in tests. + 'jsdoc/require-jsdoc': ['off'], + 'prefer-rest-params': ['off'], + 'no-invalid-this': ['off'], + }, + }, + { + files: ['tests/node/**'], + languageOptions: { + globals: { + 'console': true, + 'require': true, + ...globals.mocha, + ...globals.node, + }, + }, + }, + { + files: ['tests/playgrounds/**', 'tests/scripts/**'], + languageOptions: { + globals: { + ...globals.browser, + }, + }, + }, + { + files: ['scripts/**'], + languageOptions: { + globals: { + ...globals.browser, + }, + }, + rules: { + 'jsdoc/check-values': ['off'], + 'jsdoc/require-returns': ['off'], + 'jsdoc/tag-lines': ['off'], + }, + }, + ...tseslint.config( + buildTSOverride({ + files: ['**/*.ts', '**/*.tsx'], + tsconfig: './tsconfig.json', + }), + buildTSOverride({ + files: ['tests/typescript/**/*.ts', 'tests/typescript/**/*.tsx'], + tsconfig: './tests/typescript/tsconfig.json', + }), + ), + // Per the docs, this should be at the end because it disables rules that + // conflict with Prettier. + eslintPluginPrettierRecommended, +]; diff --git a/package-lock.json b/package-lock.json index 971bc80c9..ff83cb6d8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,16 +20,16 @@ "@hyperjump/json-schema": "^1.5.0", "@microsoft/api-documenter": "^7.22.4", "@microsoft/api-extractor": "^7.29.5", - "@typescript-eslint/eslint-plugin": "^8.1.0", - "@typescript-eslint/parser": "^8.1.0", "async-done": "^2.0.0", "chai": "^5.1.1", "concurrently": "^9.0.1", - "eslint": "^8.4.1", + "eslint": "^9.15.0", "eslint-config-google": "^0.14.0", - "eslint-config-prettier": "^9.0.0", - "eslint-plugin-jsdoc": "^50.4.3", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-jsdoc": "^50.5.0", + "eslint-plugin-prettier": "^5.2.1", "glob": "^10.3.4", + "globals": "^15.12.0", "google-closure-compiler": "^20240317.0.0", "gulp": "^5.0.0", "gulp-concat": "^2.6.1", @@ -52,6 +52,7 @@ "readline-sync": "^1.4.10", "rimraf": "^5.0.0", "typescript": "^5.3.3", + "typescript-eslint": "^8.16.0", "webdriverio": "^9.0.7", "yargs": "^17.2.1" }, @@ -264,24 +265,47 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.1.tgz", - "integrity": "sha512-Zm2NGpWELsQAD1xsJzGQpYfvICSsFkEpU0jxBjfdC6uNEWXcHnfs9hScFWtXVDVl+rBQJGrl4g1vcKIejpH9dA==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, + "node_modules/@eslint/config-array": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.0.tgz", + "integrity": "sha512-zdHg2FPIFNKPdcHWtiNT+jEFCHYVplAXRDlQDyqy0zGx/q2parwh7brGJSiTxRk/TSMkbM//zt/f5CHgyTyaSQ==", + "dev": true, + "dependencies": { + "@eslint/object-schema": "^2.1.4", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.9.0.tgz", + "integrity": "sha512-7ATR9F0e4W85D/0w7cU0SNj7qkAexMG+bAHEZOjo9akvGuhHE2m7umzWzfnpa0XAg5Kxc1BWmtPMV67jJ+9VUg==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, "node_modules/@eslint/eslintrc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", - "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.2.0.tgz", + "integrity": "sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==", "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", + "espree": "^10.0.1", + "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -289,19 +313,52 @@ "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, - "node_modules/@eslint/js": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", - "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "dev": true, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/js": { + "version": "9.15.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.15.0.tgz", + "integrity": "sha512-tMTqrY+EzbXmKJR5ToI8lxu7jaN5EdmrBFJpQk5JmSlyLsx6o4t27r883K5xsLuCYCpfKBCGswMSWXsM+jB7lg==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz", + "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.3.tgz", + "integrity": "sha512-2b/g5hRmpbb1o4GnTZax9N9m0FXzz9OV42ZzI4rDDMDuHUqigAiQCEWChBWCY4ztAGVRjoWT19v0yMmc5/L5kA==", + "dev": true, + "dependencies": { + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@gulp-sourcemaps/identity-map": { @@ -422,18 +479,39 @@ "node": ">=10.13.0" } }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.11.14", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", - "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", "dev": true, "dependencies": { - "@humanwhocodes/object-schema": "^2.0.2", - "debug": "^4.3.1", - "minimatch": "^3.0.5" + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.3.0" }, "engines": { - "node": ">=10.10.0" + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "dev": true, + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" } }, "node_modules/@humanwhocodes/module-importer": { @@ -449,11 +527,18 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", - "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", - "dev": true + "node_modules/@humanwhocodes/retry": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.1.tgz", + "integrity": "sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==", + "dev": true, + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } }, "node_modules/@hyperjump/browser": { "version": "1.1.6", @@ -1065,12 +1150,24 @@ "integrity": "sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==", "dev": true }, + "node_modules/@types/estree": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "dev": true + }, "node_modules/@types/expect": { "version": "1.20.4", "resolved": "https://registry.npmjs.org/@types/expect/-/expect-1.20.4.tgz", "integrity": "sha512-Q5Vn3yjTDyCMV50TB6VRIbQNxSE4OmZR86VSbGaNpfUolm0iePBB4KdEEHmxoY5sT2+2DIvXW0rvMDP2nHZ4Mg==", "dev": true }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true + }, "node_modules/@types/node": { "version": "20.16.3", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.3.tgz", @@ -1122,16 +1219,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.14.0.tgz", - "integrity": "sha512-tqp8H7UWFaZj0yNO6bycd5YjMwxa6wIHOLZvWPkidwbgLCsBMetQoGj7DPuAlWa2yGO3H48xmPwjhsSPPCGU5w==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.16.0.tgz", + "integrity": "sha512-5YTHKV8MYlyMI6BaEG7crQ9BhSc8RxzshOReKwZwRWN0+XvvTOm+L/UYLCYxFpfwYuAAqhxiq4yae0CMFwbL7Q==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.14.0", - "@typescript-eslint/type-utils": "8.14.0", - "@typescript-eslint/utils": "8.14.0", - "@typescript-eslint/visitor-keys": "8.14.0", + "@typescript-eslint/scope-manager": "8.16.0", + "@typescript-eslint/type-utils": "8.16.0", + "@typescript-eslint/utils": "8.16.0", + "@typescript-eslint/visitor-keys": "8.16.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -1155,15 +1252,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.15.0.tgz", - "integrity": "sha512-7n59qFpghG4uazrF9qtGKBZXn7Oz4sOMm8dwNWDQY96Xlm2oX67eipqcblDj+oY1lLCbf1oltMZFpUso66Kl1A==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.16.0.tgz", + "integrity": "sha512-D7DbgGFtsqIPIFMPJwCad9Gfi/hC0PWErRRHFnaCWoEDYi5tQUDiJCTmGUbBiLzjqAck4KcXt9Ayj0CNlIrF+w==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "8.15.0", - "@typescript-eslint/types": "8.15.0", - "@typescript-eslint/typescript-estree": "8.15.0", - "@typescript-eslint/visitor-keys": "8.15.0", + "@typescript-eslint/scope-manager": "8.16.0", + "@typescript-eslint/types": "8.16.0", + "@typescript-eslint/typescript-estree": "8.16.0", + "@typescript-eslint/visitor-keys": "8.16.0", "debug": "^4.3.4" }, "engines": { @@ -1182,137 +1279,14 @@ } } }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.15.0.tgz", - "integrity": "sha512-QRGy8ADi4J7ii95xz4UoiymmmMd/zuy9azCaamnZ3FM8T5fZcex8UfJcjkiEZjJSztKfEBe3dZ5T/5RHAmw2mA==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "8.15.0", - "@typescript-eslint/visitor-keys": "8.15.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.15.0.tgz", - "integrity": "sha512-n3Gt8Y/KyJNe0S3yDCD2RVKrHBC4gTUcLTebVBXacPy091E6tNspFLKRXlk3hwT4G55nfr1n2AdFqi/XMxzmPQ==", - "dev": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.15.0.tgz", - "integrity": "sha512-1eMp2JgNec/niZsR7ioFBlsh/Fk0oJbhaqO0jRyQBMgkz7RrFfkqF9lYYmBoGBaSiLnu8TAPQTwoTUiSTUW9dg==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "8.15.0", - "@typescript-eslint/visitor-keys": "8.15.0", - "debug": "^4.3.4", - "fast-glob": "^3.3.2", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^1.3.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.15.0.tgz", - "integrity": "sha512-h8vYOulWec9LhpwfAdZf2bjr8xIp0KNKnpgqSz0qqYYKAW/QZKw3ktRndbiAtUz4acH4QLQavwZBYCc0wulA/Q==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "8.15.0", - "eslint-visitor-keys": "^4.2.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/eslint-visitor-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", - "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", - "dev": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.14.0.tgz", - "integrity": "sha512-aBbBrnW9ARIDn92Zbo7rguLnqQ/pOrUguVpbUwzOhkFg2npFDwTgPGqFqE0H5feXcOoJOfX3SxlJaKEVtq54dw==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.16.0.tgz", + "integrity": "sha512-mwsZWubQvBki2t5565uxF0EYvG+FwdFb8bMtDuGQLdCCnGPrDEDvm1gtfynuKlnpzeBRqdFCkMf9jg1fnAK8sg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.14.0", - "@typescript-eslint/visitor-keys": "8.14.0" + "@typescript-eslint/types": "8.16.0", + "@typescript-eslint/visitor-keys": "8.16.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1323,13 +1297,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.14.0.tgz", - "integrity": "sha512-Xcz9qOtZuGusVOH5Uk07NGs39wrKkf3AxlkK79RBK6aJC1l03CobXjJbwBPSidetAOV+5rEVuiT1VSBUOAsanQ==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.16.0.tgz", + "integrity": "sha512-IqZHGG+g1XCWX9NyqnI/0CX5LL8/18awQqmkZSl2ynn8F76j579dByc0jhfVSnSnhf7zv76mKBQv9HQFKvDCgg==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "8.14.0", - "@typescript-eslint/utils": "8.14.0", + "@typescript-eslint/typescript-estree": "8.16.0", + "@typescript-eslint/utils": "8.16.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -1340,6 +1314,9 @@ "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0" + }, "peerDependenciesMeta": { "typescript": { "optional": true @@ -1347,9 +1324,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.14.0.tgz", - "integrity": "sha512-yjeB9fnO/opvLJFAsPNYlKPnEM8+z4og09Pk504dkqonT02AyL5Z9SSqlE0XqezS93v6CXn49VHvB2G7XSsl0g==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.16.0.tgz", + "integrity": "sha512-NzrHj6thBAOSE4d9bsuRNMvk+BvaQvmY4dDglgkgGC0EW/tB3Kelnp3tAKH87GEwzoxgeQn9fNGRyFJM/xd+GQ==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1360,13 +1337,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.14.0.tgz", - "integrity": "sha512-OPXPLYKGZi9XS/49rdaCbR5j/S14HazviBlUQFvSKz3npr3NikF+mrgK7CFVur6XEt95DZp/cmke9d5i3vtVnQ==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.16.0.tgz", + "integrity": "sha512-E2+9IzzXMc1iaBy9zmo+UYvluE3TW7bCGWSF41hVWUE01o8nzr1rvOQYSxelxr6StUvRcTMe633eY8mXASMaNw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.14.0", - "@typescript-eslint/visitor-keys": "8.14.0", + "@typescript-eslint/types": "8.16.0", + "@typescript-eslint/visitor-keys": "8.16.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -1424,15 +1401,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.14.0.tgz", - "integrity": "sha512-OGqj6uB8THhrHj0Fk27DcHPojW7zKwKkPmHXHvQ58pLYp4hy8CSUdTKykKeh+5vFqTTVmjz0zCOOPKRovdsgHA==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.16.0.tgz", + "integrity": "sha512-C1zRy/mOL8Pj157GiX4kaw7iyRLKfJXBR3L82hk5kS/GyHcOFmy4YUq/zfZti72I9wnuQtA/+xzft4wCC8PJdA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.14.0", - "@typescript-eslint/types": "8.14.0", - "@typescript-eslint/typescript-estree": "8.14.0" + "@typescript-eslint/scope-manager": "8.16.0", + "@typescript-eslint/types": "8.16.0", + "@typescript-eslint/typescript-estree": "8.16.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1443,16 +1420,21 @@ }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.14.0.tgz", - "integrity": "sha512-vG0XZo8AdTH9OE6VFRwAZldNc7qtJ/6NLGWak+BtENuEUXGZgFpihILPiBvKXvJ2nFu27XNGC6rKiwuaoMbYzQ==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.16.0.tgz", + "integrity": "sha512-pq19gbaMOmFE3CbL0ZB8J8BFCo2ckfHBfaIsaOZgBIF4EoISJIdLX5xRhd0FGB0LlHReNRuzoJoMGpTjq8F2CQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.14.0", - "eslint-visitor-keys": "^3.4.3" + "@typescript-eslint/types": "8.16.0", + "eslint-visitor-keys": "^4.2.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1462,11 +1444,17 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@ungap/structured-clone": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", - "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", - "dev": true + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } }, "node_modules/@wdio/config": { "version": "9.0.8", @@ -2948,9 +2936,9 @@ } }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, "dependencies": { "path-key": "^3.1.0", @@ -3236,18 +3224,6 @@ "node": ">=0.3.1" } }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/dom-serializer": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", @@ -3577,58 +3553,62 @@ } }, "node_modules/eslint": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", - "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", + "version": "9.15.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.15.0.tgz", + "integrity": "sha512-7CrWySmIibCgT1Os28lUU6upBshZ+GxybLOrmRzi08kS8MBuO8QA7pXEgYgY5W8vK3e74xv0lpjo9DbaGU9Rkw==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.57.0", - "@humanwhocodes/config-array": "^0.11.14", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.19.0", + "@eslint/core": "^0.9.0", + "@eslint/eslintrc": "^3.2.0", + "@eslint/js": "9.15.0", + "@eslint/plugin-kit": "^0.2.3", + "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "@ungap/structured-clone": "^1.2.0", + "@humanwhocodes/retry": "^0.4.1", + "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", + "cross-spawn": "^7.0.5", "debug": "^4.3.2", - "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", + "eslint-scope": "^8.2.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", + "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", + "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" + "optionator": "^0.9.3" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } } }, "node_modules/eslint-config-google": { @@ -3656,9 +3636,9 @@ } }, "node_modules/eslint-plugin-jsdoc": { - "version": "50.4.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-50.4.3.tgz", - "integrity": "sha512-uWtwFxGRv6B8sU63HZM5dAGDhgsatb+LONwmILZJhdRALLOkCX2HFZhdL/Kw2ls8SQMAVEfK+LmnEfxInRN8HA==", + "version": "50.5.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-50.5.0.tgz", + "integrity": "sha512-xTkshfZrUbiSHXBwZ/9d5ulZ2OcHXxSvm/NPo494H/hadLRJwOq5PMV0EUpMqsb9V+kQo+9BAgi6Z7aJtdBp2A==", "dev": true, "dependencies": { "@es-joy/jsdoccomment": "~0.49.0", @@ -3680,35 +3660,6 @@ "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" } }, - "node_modules/eslint-plugin-jsdoc/node_modules/eslint-visitor-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", - "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", - "dev": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-plugin-jsdoc/node_modules/espree": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", - "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", - "dev": true, - "dependencies": { - "acorn": "^8.14.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.2.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, "node_modules/eslint-plugin-jsdoc/node_modules/semver": { "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", @@ -3731,17 +3682,47 @@ "spdx-license-ids": "^3.0.0" } }, + "node_modules/eslint-plugin-prettier": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.1.tgz", + "integrity": "sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==", + "dev": true, + "dependencies": { + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.9.1" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-plugin-prettier" + }, + "peerDependencies": { + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "eslint-config-prettier": "*", + "prettier": ">=3.0.0" + }, + "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, + "eslint-config-prettier": { + "optional": true + } + } + }, "node_modules/eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", + "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", "dev": true, "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -3759,6 +3740,18 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/eslint/node_modules/glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", @@ -3772,17 +3765,29 @@ } }, "node_modules/espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", "dev": true, "dependencies": { - "acorn": "^8.9.0", + "acorn": "^8.14.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" + "eslint-visitor-keys": "^4.2.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -3964,6 +3969,12 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, + "node_modules/fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true + }, "node_modules/fast-fifo": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz", @@ -3975,7 +3986,6 @@ "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, - "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -4072,15 +4082,15 @@ } }, "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "dev": true, "dependencies": { - "flat-cache": "^3.0.4" + "flat-cache": "^4.0.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16.0.0" } }, "node_modules/fill-range": { @@ -4170,57 +4180,22 @@ } }, "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "dev": true, "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" + "flatted": "^3.2.9", + "keyv": "^4.5.4" }, "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/flat-cache/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/flat-cache/node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">=16" } }, "node_modules/flatted": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.4.tgz", - "integrity": "sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", + "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", "dev": true }, "node_modules/follow-redirects": { @@ -4640,27 +4615,12 @@ } }, "node_modules/globals": { - "version": "13.23.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", - "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", - "dev": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/globals/node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "version": "15.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.12.0.tgz", + "integrity": "sha512-1+gLErljJFhbOVyaetcwJiJ4+eLe45S2E7P5UiZ9xGfeq3ATQf5DOv9G7MH3gGbKQLkzmNh2DxfZwLdw+j6oTQ==", "dev": true, "engines": { - "node": ">=10" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -5599,15 +5559,6 @@ "node": ">=0.12.0" } }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/is-plain-object": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", @@ -5878,6 +5829,12 @@ "node": ">=18" } }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -5983,6 +5940,15 @@ "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", "dev": true }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, "node_modules/klaw-sync": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", @@ -6290,7 +6256,6 @@ "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true, - "license": "MIT", "engines": { "node": ">= 8" } @@ -7211,6 +7176,18 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/prettier-plugin-organize-imports": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-4.0.0.tgz", @@ -8237,12 +8214,6 @@ "b4a": "^1.6.4" } }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true - }, "node_modules/textextensions": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/textextensions/-/textextensions-3.3.0.tgz", @@ -8428,6 +8399,32 @@ "node": ">=14.17" } }, + "node_modules/typescript-eslint": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.16.0.tgz", + "integrity": "sha512-wDkVmlY6O2do4V+lZd0GtRfbtXbeD0q9WygwXXSJnC1xorE8eqyC2L1tJimqpSeFrOzRlYtWnUp/uzgHQOgfBQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.16.0", + "@typescript-eslint/parser": "8.16.0", + "@typescript-eslint/utils": "8.16.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "node_modules/unbzip2-stream": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz", diff --git a/package.json b/package.json index 10b5e2ab9..afa6e7d90 100644 --- a/package.json +++ b/package.json @@ -107,16 +107,16 @@ "@hyperjump/json-schema": "^1.5.0", "@microsoft/api-documenter": "^7.22.4", "@microsoft/api-extractor": "^7.29.5", - "@typescript-eslint/eslint-plugin": "^8.1.0", - "@typescript-eslint/parser": "^8.1.0", "async-done": "^2.0.0", "chai": "^5.1.1", "concurrently": "^9.0.1", - "eslint": "^8.4.1", + "eslint": "^9.15.0", "eslint-config-google": "^0.14.0", - "eslint-config-prettier": "^9.0.0", - "eslint-plugin-jsdoc": "^50.4.3", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-jsdoc": "^50.5.0", + "eslint-plugin-prettier": "^5.2.1", "glob": "^10.3.4", + "globals": "^15.12.0", "google-closure-compiler": "^20240317.0.0", "gulp": "^5.0.0", "gulp-concat": "^2.6.1", @@ -139,6 +139,7 @@ "readline-sync": "^1.4.10", "rimraf": "^5.0.0", "typescript": "^5.3.3", + "typescript-eslint": "^8.16.0", "webdriverio": "^9.0.7", "yargs": "^17.2.1" }, diff --git a/scripts/helpers.js b/scripts/helpers.js index 8150593dd..08a147d3e 100644 --- a/scripts/helpers.js +++ b/scripts/helpers.js @@ -35,7 +35,7 @@ function posixPath(target) { * @return {string} The value s as a eval-able string literal. */ function quote(str) { - /* eslint-disable no-control-regex, no-multi-spaces */ + /* eslint-disable no-control-regex */ /** Regexp for characters to be escaped in a single-quoted string. */ const singleRE = /[\x00-\x1f\\\u2028\u2029']/g; @@ -63,7 +63,7 @@ function quote(str) { '\u2028': '\\u2028', '\u2029': '\\u2029', }; - /* eslint-enable no-control-regex, no-multi-spaces */ + /* eslint-enable no-control-regex */ return "'" + str.replace(singleRE, (c) => replacements[c]) + "'"; } diff --git a/tests/.eslintrc.json b/tests/.eslintrc.json deleted file mode 100644 index 1d5e1fea2..000000000 --- a/tests/.eslintrc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "globals": { - "Blockly": true, - "dartGenerator": true, - "javascriptGenerator": true, - "luaGenerator": true, - "phpGenerator": true, - "pythonGenerator": true - } -} diff --git a/tests/browser/.eslintrc.json b/tests/browser/.eslintrc.json deleted file mode 100644 index 2fe4f6a6b..000000000 --- a/tests/browser/.eslintrc.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "env": { - "browser": true, - "mocha": true, - "node": true - }, - "globals": { - "chai": false, - "sinon": false - }, - "rules": { - "no-unused-vars": ["off"], - // Allow uncommented helper functions in tests. - "require-jsdoc": ["off"], - "prefer-rest-params": ["off"], - "no-invalid-this": ["off"], - "valid-jsdoc": [ - "error", - { - "requireReturnType": false, - "requireParamType": false - } - ] - }, - "extends": "../../.eslintrc.js", - "parserOptions": { - "sourceType": "module" - } -} diff --git a/tests/migration/validate-renamings.mjs b/tests/migration/validate-renamings.mjs index d9c66ef9c..e7f9f4a70 100755 --- a/tests/migration/validate-renamings.mjs +++ b/tests/migration/validate-renamings.mjs @@ -25,38 +25,39 @@ const RENAMINGS_URL = new URL( import.meta.url, ); -const renamingsJson5 = await readFile(RENAMINGS_URL); -const renamings = JSON5.parse(renamingsJson5); +readFile(RENAMINGS_URL).then((renamingsJson5) => { + const renamings = JSON5.parse(renamingsJson5); -const output = await validate(SCHEMA_URL, renamings, BASIC); - -if (!output.valid) { - console.error(`Renamings file is invalid. First error occurs at: + validate(SCHEMA_URL, renamings, BASIC).then((output) => { + if (!output.valid) { + console.error(`Renamings file is invalid. First error occurs at: ${output.errors[0].instanceLocation}`); - console.info( - `Here is the full validator output, in case that helps:\n`, - output, - ); - process.exit(1); -} - -// File passed schema validation. Do some additional checks. -let ok = true; -Object.entries(renamings).forEach(([version, modules]) => { - // Scan through modules and check for duplicates. - const seen = new Set(); - for (const {oldName} of modules) { - if (seen.has(oldName)) { - console.error( - `Duplicate entry for module ${oldName} ` + `in version ${version}.`, + console.info( + `Here is the full validator output, in case that helps:\n`, + output, ); - ok = false; + process.exit(1); } - seen.add(oldName); - } + + // File passed schema validation. Do some additional checks. + let ok = true; + Object.entries(renamings).forEach(([version, modules]) => { + // Scan through modules and check for duplicates. + const seen = new Set(); + for (const {oldName} of modules) { + if (seen.has(oldName)) { + console.error( + `Duplicate entry for module ${oldName} ` + `in version ${version}.`, + ); + ok = false; + } + seen.add(oldName); + } + }); + if (!ok) { + console.error('Renamings file is invalid.'); + process.exit(1); + } + // Default is a successful exit 0. + }); }); -if (!ok) { - console.error('Renamings file is invalid.'); - process.exit(1); -} -// Default is a successful exit 0. diff --git a/tests/mocha/.eslintrc.json b/tests/mocha/.eslintrc.json deleted file mode 100644 index 0de898aa6..000000000 --- a/tests/mocha/.eslintrc.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "env": { - "browser": true, - "mocha": true - }, - "globals": { - "chai": false, - "sinon": false - }, - "rules": { - "no-unused-vars": ["off"], - // Allow uncommented helper functions in tests. - "require-jsdoc": ["off"], - "prefer-rest-params": ["off"], - "no-invalid-this": ["off"] - }, - "extends": "../../.eslintrc.js", - "parserOptions": { - "sourceType": "module" - } -} diff --git a/tests/mocha/serializer_test.js b/tests/mocha/serializer_test.js index 0cc073e7b..a3a3761e9 100644 --- a/tests/mocha/serializer_test.js +++ b/tests/mocha/serializer_test.js @@ -484,7 +484,6 @@ Serializer.Fields.TextInput.Simple = new SerializerTestCase( '' + '', ); -/* eslint-disable no-tabs */ Serializer.Fields.TextInput.Tabs = new SerializerTestCase( 'Tabs', '' + @@ -493,7 +492,6 @@ Serializer.Fields.TextInput.Tabs = new SerializerTestCase( '' + '', ); -/* eslint-enable no-tabs */ Serializer.Fields.TextInput.Symbols = new SerializerTestCase( 'Symbols', '' + @@ -621,7 +619,6 @@ Serializer.Fields.Variable.Types = new SerializerTestCase( '' + '', ); -/* eslint-disable no-tabs */ Serializer.Fields.Variable.Tabs = new SerializerTestCase( 'Tabs', '' + @@ -633,7 +630,6 @@ Serializer.Fields.Variable.Tabs = new SerializerTestCase( '' + '', ); -/* eslint-enable no-tabs */ Serializer.Fields.Variable.Symbols = new SerializerTestCase( 'Symbols', '' + diff --git a/tests/mocha/test_helpers/code_generation.js b/tests/mocha/test_helpers/code_generation.js index 427b9bd51..95bd902cd 100644 --- a/tests/mocha/test_helpers/code_generation.js +++ b/tests/mocha/test_helpers/code_generation.js @@ -1,4 +1,3 @@ -/* eslint-disable valid-jsdoc */ /** * @license * Copyright 2020 Google LLC diff --git a/tests/mocha/workspace_test.js b/tests/mocha/workspace_test.js index a517d796c..20cdab6e4 100644 --- a/tests/mocha/workspace_test.js +++ b/tests/mocha/workspace_test.js @@ -20,6 +20,5 @@ suite('Workspace', function () { sharedTestTeardown.call(this); }); - // eslint-disable-next-line no-use-before-define testAWorkspace(); }); diff --git a/tests/node/.eslintrc.json b/tests/node/.eslintrc.json deleted file mode 100644 index c8e8d67c1..000000000 --- a/tests/node/.eslintrc.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "env": { - "node": true, - "browser": false, - "mocha": true - }, - "globals": { - "console": true, - "require": true - }, - "extends": "../../.eslintrc.js" -} diff --git a/tests/playgrounds/screenshot.js b/tests/playgrounds/screenshot.js index c443755a5..11a86ba1a 100644 --- a/tests/playgrounds/screenshot.js +++ b/tests/playgrounds/screenshot.js @@ -40,7 +40,7 @@ function svgToPng_(data, width, height, callback) { const dataUri = canvas.toDataURL('image/png'); callback(dataUri); } catch (err) { - console.warn('Error converting the workspace svg to a png'); + console.warn('Error converting the workspace svg to a png: ' + err); callback(''); } }; From cd1e540cca157d7b7b7ccfda521de3ec13372b91 Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Tue, 3 Dec 2024 13:40:26 -0800 Subject: [PATCH 82/90] fix: Disable newly created function call blocks when the corresponding definition is disabled. (#8665) --- blocks/procedures.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/blocks/procedures.ts b/blocks/procedures.ts index bf9a9206b..20d8fa36b 100644 --- a/blocks/procedures.ts +++ b/blocks/procedures.ts @@ -1099,6 +1099,14 @@ const PROCEDURE_CALL_COMMON = { xml.appendChild(block); Xml.domToWorkspace(xml, this.workspace); Events.setGroup(false); + } else if (!def.isEnabled()) { + this.setDisabledReason( + true, + DISABLED_PROCEDURE_DEFINITION_DISABLED_REASON, + ); + this.setWarningText( + Msg['PROCEDURES_CALL_DISABLED_DEF_WARNING'].replace('%1', name), + ); } } else if (event.type === Events.BLOCK_DELETE) { // Look for the case where a procedure definition has been deleted, From 24ab50d49d3fddcbf270743883121435fad078ce Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Tue, 3 Dec 2024 13:41:32 -0800 Subject: [PATCH 83/90] fix: Fix bug that caused text to be selected when long-pressing in the workspace on a touch device. (#8670) * fix: Fix bug that caused text to be selected when long-pressing in the workspace on a touch device. * chore: Fix test failure. --- core/css.ts | 13 ++----------- core/toolbox/toolbox.ts | 1 - tests/mocha/toolbox_test.js | 5 +---- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/core/css.ts b/core/css.ts index 20c573093..2186af04a 100644 --- a/core/css.ts +++ b/core/css.ts @@ -79,6 +79,8 @@ let content = ` position: relative; overflow: hidden; /* So blocks in drag surface disappear at edges */ touch-action: none; + user-select: none; + -webkit-user-select: none; } .blocklyNonSelectable { @@ -266,17 +268,6 @@ let content = ` cursor: default; } -/* - Don't allow users to select text. It gets annoying when trying to - drag a block and selected text moves instead. -*/ -.blocklySvg text { - user-select: none; - -ms-user-select: none; - -webkit-user-select: none; - cursor: inherit; -} - .blocklyHidden { display: none; } diff --git a/core/toolbox/toolbox.ts b/core/toolbox/toolbox.ts index 457d5d43b..120378393 100644 --- a/core/toolbox/toolbox.ts +++ b/core/toolbox/toolbox.ts @@ -197,7 +197,6 @@ export class Toolbox const toolboxContainer = document.createElement('div'); toolboxContainer.setAttribute('layout', this.isHorizontal() ? 'h' : 'v'); dom.addClass(toolboxContainer, 'blocklyToolboxDiv'); - dom.addClass(toolboxContainer, 'blocklyNonSelectable'); toolboxContainer.setAttribute('dir', this.RTL ? 'RTL' : 'LTR'); return toolboxContainer; } diff --git a/tests/mocha/toolbox_test.js b/tests/mocha/toolbox_test.js index 70f5ff8f9..3b69fac5d 100644 --- a/tests/mocha/toolbox_test.js +++ b/tests/mocha/toolbox_test.js @@ -47,10 +47,7 @@ suite('Toolbox', function () { test('Init called -> HtmlDiv is inserted before parent node', function () { const toolboxDiv = Blockly.common.getMainWorkspace().getInjectionDiv() .childNodes[0]; - assert.equal( - toolboxDiv.className, - 'blocklyToolboxDiv blocklyNonSelectable', - ); + assert.equal(toolboxDiv.className, 'blocklyToolboxDiv'); }); test('Init called -> Toolbox is subscribed to background and foreground colour', function () { const themeManager = this.toolbox.workspace_.getThemeManager(); From 09bdd39cb23bcfaa9c7bc02a50294d2e8d9b446e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 13:47:10 -0800 Subject: [PATCH 84/90] chore(deps): bump eslint from 8.57.0 to 9.16.0 (#8680) Bumps [eslint](https://github.com/eslint/eslint) from 8.57.0 to 9.16.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.57.0...v9.16.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index ff83cb6d8..7bd880eb6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -332,9 +332,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.15.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.15.0.tgz", - "integrity": "sha512-tMTqrY+EzbXmKJR5ToI8lxu7jaN5EdmrBFJpQk5JmSlyLsx6o4t27r883K5xsLuCYCpfKBCGswMSWXsM+jB7lg==", + "version": "9.16.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.16.0.tgz", + "integrity": "sha512-tw2HxzQkrbeuvyj1tG2Yqq+0H9wGoI2IMk4EOsQeX+vmd75FtJAzf+gTA69WF+baUKRYQ3x2kbLE08js5OsTVg==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -3553,9 +3553,9 @@ } }, "node_modules/eslint": { - "version": "9.15.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.15.0.tgz", - "integrity": "sha512-7CrWySmIibCgT1Os28lUU6upBshZ+GxybLOrmRzi08kS8MBuO8QA7pXEgYgY5W8vK3e74xv0lpjo9DbaGU9Rkw==", + "version": "9.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.16.0.tgz", + "integrity": "sha512-whp8mSQI4C8VXd+fLgSM0lh3UlmcFtVwUQjyKCFfsp+2ItAIYhlq/hqGahGqHE6cv9unM41VlqKk2VtKYR2TaA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", @@ -3563,7 +3563,7 @@ "@eslint/config-array": "^0.19.0", "@eslint/core": "^0.9.0", "@eslint/eslintrc": "^3.2.0", - "@eslint/js": "9.15.0", + "@eslint/js": "9.16.0", "@eslint/plugin-kit": "^0.2.3", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", From 43ebf20500fbc599408e1081fcb1bd7ab580242d Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Tue, 3 Dec 2024 14:17:09 -0800 Subject: [PATCH 85/90] chore: Remove CSS targeting multiline input field. (#8684) --- core/css.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/core/css.ts b/core/css.ts index 2186af04a..c7443e5f0 100644 --- a/core/css.ts +++ b/core/css.ts @@ -251,10 +251,6 @@ let content = ` stroke: none; } -.blocklyMultilineText { - font-family: monospace; -} - .blocklyNonEditableText>text { pointer-events: none; } From 6118ffe8fcd0bb446a2dd9f4bff3d0b12a27edf4 Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Tue, 3 Dec 2024 14:48:41 -0800 Subject: [PATCH 86/90] chore: Remove obsolete workaround for resize events on iPads. (#8669) --- core/inject.ts | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/core/inject.ts b/core/inject.ts index 55409b7f3..b425d77b7 100644 --- a/core/inject.ts +++ b/core/inject.ts @@ -22,7 +22,6 @@ import * as Touch from './touch.js'; import * as aria from './utils/aria.js'; import * as dom from './utils/dom.js'; import {Svg} from './utils/svg.js'; -import * as userAgent from './utils/useragent.js'; import * as WidgetDiv from './widgetdiv.js'; import {WorkspaceSvg} from './workspace_svg.js'; @@ -337,18 +336,6 @@ function bindDocumentEvents() { // should run regardless of what other touch event handlers have run. browserEvents.bind(document, 'touchend', null, Touch.longStop); browserEvents.bind(document, 'touchcancel', null, Touch.longStop); - // Some iPad versions don't fire resize after portrait to landscape change. - if (userAgent.IPAD) { - browserEvents.conditionalBind( - window, - 'orientationchange', - document, - function () { - // TODO (#397): Fix for multiple Blockly workspaces. - common.svgResize(common.getMainWorkspace() as WorkspaceSvg); - }, - ); - } } documentEventsBound = true; } From eb79f667e2590bf48b37492c73e532bec2aa18b1 Mon Sep 17 00:00:00 2001 From: echoooooo <2070343088@email.szu.edu.cn> Date: Thu, 5 Dec 2024 00:54:34 +0800 Subject: [PATCH 87/90] fix: typo in comment (#8685) --- core/generator.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/generator.ts b/core/generator.ts index 869e29a6a..5884b4e54 100644 --- a/core/generator.ts +++ b/core/generator.ts @@ -24,7 +24,7 @@ import type {Workspace} from './workspace.js'; * @deprecated * @see {@link https://developers.google.com/blockly/guides/create-custom-blocks/generating-code} * @param block The Block instance to generate code for. - * @param genearator The CodeGenerator calling the function. + * @param generator The CodeGenerator calling the function. * @returns A string containing the generated code (for statement blocks), * or a [code, precedence] tuple (for value/expression blocks), or * null if no code should be emitted for block. From 72198001831a81a63d840faf8de267b7da92c0a8 Mon Sep 17 00:00:00 2001 From: "Mateus S. Pereira" <68961261+mateusslezinsky@users.noreply.github.com> Date: Wed, 4 Dec 2024 14:25:01 -0300 Subject: [PATCH 88/90] fix: workspace shifts when deleting a block (#8666) * fix: workspace shifts when deleting a block * fix: awaiting for block rerender * fix: create reusable method to prevent marking method as async --- core/dragging/block_drag_strategy.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/core/dragging/block_drag_strategy.ts b/core/dragging/block_drag_strategy.ts index c3be97da6..c9a1ea0ab 100644 --- a/core/dragging/block_drag_strategy.ts +++ b/core/dragging/block_drag_strategy.ts @@ -384,19 +384,24 @@ export class BlockDragStrategy implements IDragStrategy { if (this.connectionCandidate) { // Applying connections also rerenders the relevant blocks. this.applyConnections(this.connectionCandidate); + this.disposeStep(); } else { - this.block.queueRender(); + this.block.queueRender().then(() => this.disposeStep()); } + + if (!this.inGroup) { + eventUtils.setGroup(false); + } + } + + /** Disposes of any state at the end of the drag. */ + private disposeStep() { this.block.snapToGrid(); // Must dispose after connections are applied to not break the dynamic // connections plugin. See #7859 this.connectionPreviewer!.dispose(); this.workspace.setResizesEnabled(true); - - if (!this.inGroup) { - eventUtils.setGroup(false); - } } /** Connects the given candidate connections. */ From 4680b4b5c1b4606fa147289125ed0bd4666babbd Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Wed, 4 Dec 2024 17:30:22 +0000 Subject: [PATCH 89/90] test: Disable failing tests (#8677) See issue #8676. --- tests/mocha/workspace_svg_test.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/mocha/workspace_svg_test.js b/tests/mocha/workspace_svg_test.js index 8282e7ac2..0cd6da828 100644 --- a/tests/mocha/workspace_svg_test.js +++ b/tests/mocha/workspace_svg_test.js @@ -502,7 +502,8 @@ suite('WorkspaceSvg', function () { ); }); - test('two blocks first at (10, 15) second at (0, 0) do not switch places', function () { + // TODO(#8676): Reenable once test passes reliably. + test.skip('two blocks first at (10, 15) second at (0, 0) do not switch places', function () { const blockJson1 = { 'type': 'math_number', 'id': 'block1', @@ -538,7 +539,8 @@ suite('WorkspaceSvg', function () { ); }); - test('two overlapping blocks are moved to origin and below', function () { + // TODO(#8676): Reenable once test passes reliably. + test.skip('two overlapping blocks are moved to origin and below', function () { const blockJson1 = { 'type': 'math_number', 'id': 'block1', @@ -618,7 +620,8 @@ suite('WorkspaceSvg', function () { ); }); - test('two overlapping blocks are moved to origin and below including children', function () { + // TODO(#8676): Reenable once test passes reliably. + test.skip('two overlapping blocks are moved to origin and below including children', function () { const blockJson1 = { 'type': 'logic_negate', 'id': 'block1', @@ -682,7 +685,8 @@ suite('WorkspaceSvg', function () { ); }); - test('two large overlapping blocks are moved to origin and below', function () { + // TODO(#8676): Reenable once test passes reliably. + test.skip('two large overlapping blocks are moved to origin and below', function () { const blockJson1 = { 'type': 'controls_repeat_ext', 'id': 'block1', From 0104166c371eaae69ae6439daf9f50f4aadf6b09 Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Wed, 4 Dec 2024 10:26:10 -0800 Subject: [PATCH 90/90] release: Update version number to 11.2.0-beta.2 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3b3d3407b..0e4db3c8d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "blockly", - "version": "11.2.0-beta.1", + "version": "11.2.0-beta.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "blockly", - "version": "11.2.0-beta.1", + "version": "11.2.0-beta.2", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index 48038c0fc..d6302bc8a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "blockly", - "version": "11.2.0-beta.1", + "version": "11.2.0-beta.2", "description": "Blockly is a library for building visual programming editors.", "keywords": [ "blockly"