From 2bebf6c137acac19398408f779979900bd640495 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Mar 2024 15:44:08 -0700 Subject: [PATCH 01/14] chore(deps): Bump @blockly/block-test from 5.0.4 to 5.1.0 (#7944) Bumps [@blockly/block-test](https://github.com/google/blockly-samples/tree/HEAD/plugins/block-test) from 5.0.4 to 5.1.0. - [Release notes](https://github.com/google/blockly-samples/releases) - [Changelog](https://github.com/google/blockly-samples/blob/master/plugins/block-test/CHANGELOG.md) - [Commits](https://github.com/google/blockly-samples/commits/@blockly/block-test@5.1.0/plugins/block-test) --- updated-dependencies: - dependency-name: "@blockly/block-test" 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 5142c6667..e07d19d4e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -75,9 +75,9 @@ } }, "node_modules/@blockly/block-test": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@blockly/block-test/-/block-test-5.0.4.tgz", - "integrity": "sha512-3u7z9Xd+W1eCcknqVsmUYnDvS2FIzce2IdGuRC1lst2XIQQ59q2wkUqGg4+Z2Arr3hk/TpIlHn2YLrGPkvqkug==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@blockly/block-test/-/block-test-5.1.0.tgz", + "integrity": "sha512-beqBTJbrrDGECohJo6uczeLAvRxKgMFn9Ew1po6d8PBka/aNwSkT33jHRUAeasHnraBdFBx8pwYh7By2gVZURQ==", "dev": true, "engines": { "node": ">=8.17.0" From 199c00afd5dfcc8f18518b7101c42afc3aadef9e Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Tue, 19 Mar 2024 14:08:12 -0700 Subject: [PATCH 02/14] fix: Fix block disposal animations (#7948) * fix: Fix block disposal animations * chore: Run lint * chore: Remove unused import * fix: Remove unused function arg --- core/block_animations.ts | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/core/block_animations.ts b/core/block_animations.ts index 615aa81d1..d3bd13118 100644 --- a/core/block_animations.ts +++ b/core/block_animations.ts @@ -38,18 +38,26 @@ export function disposeUiEffect(block: BlockSvg) { const svgGroup = block.getSvgRoot(); workspace.getAudioManager().play('delete'); - const xy = workspace.getSvgXY(svgGroup); + const xy = block.getRelativeToSurfaceXY(); // Deeply clone the current block. const clone: SVGGElement = svgGroup.cloneNode(true) as SVGGElement; clone.setAttribute('transform', 'translate(' + xy.x + ',' + xy.y + ')'); - workspace.getParentSvg().appendChild(clone); + if (workspace.isDragging()) { + workspace.getLayerManager()?.moveToDragLayer({ + getSvgRoot: () => { + return clone; + }, + }); + } else { + workspace.getLayerManager()?.getBlockLayer().appendChild(clone); + } const cloneRect = { 'x': xy.x, 'y': xy.y, 'width': block.width, 'height': block.height, }; - disposeUiStep(clone, cloneRect, workspace.RTL, new Date(), workspace.scale); + disposeUiStep(clone, cloneRect, workspace.RTL, new Date()); } /** * Animate a cloned block and eventually dispose of it. @@ -60,29 +68,26 @@ export function disposeUiEffect(block: BlockSvg) { * @param rect Starting rect of the clone. * @param rtl True if RTL, false if LTR. * @param start Date of animation's start. - * @param workspaceScale Scale of workspace. */ function disposeUiStep( clone: Element, rect: CloneRect, rtl: boolean, start: Date, - workspaceScale: number, ) { const ms = new Date().getTime() - start.getTime(); const percent = ms / 150; if (percent > 1) { dom.removeNode(clone); } else { - const x = - rect.x + (((rtl ? -1 : 1) * rect.width * workspaceScale) / 2) * percent; - const y = rect.y + rect.height * workspaceScale * percent; - const scale = (1 - percent) * workspaceScale; + const x = rect.x + (((rtl ? -1 : 1) * rect.width) / 2) * percent; + const y = rect.y + (rect.height / 2) * percent; + const scale = 1 - percent; clone.setAttribute( 'transform', 'translate(' + x + ',' + y + ')' + ' scale(' + scale + ')', ); - setTimeout(disposeUiStep, 10, clone, rect, rtl, start, workspaceScale); + setTimeout(disposeUiStep, 10, clone, rect, rtl, start); } } From 7d8ccebe67f967cdc10b5ad5f99d6a1fc27dd513 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 16:11:47 -0700 Subject: [PATCH 03/14] chore(deps): Bump @typescript-eslint/eslint-plugin from 6.19.0 to 7.3.1 (#7960) Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.19.0 to 7.3.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.3.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] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 379 +++++++++++----------------------------------- package.json | 2 +- 2 files changed, 87 insertions(+), 294 deletions(-) diff --git a/package-lock.json b/package-lock.json index e07d19d4e..d633e70f5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "@hyperjump/json-schema": "^1.5.0", "@microsoft/api-documenter": "^7.22.4", "@microsoft/api-extractor": "^7.29.5", - "@typescript-eslint/eslint-plugin": "^6.1.0", + "@typescript-eslint/eslint-plugin": "^7.3.1", "async-done": "^2.0.0", "chai": "^4.2.0", "concurrently": "^8.0.1", @@ -941,9 +941,9 @@ "dev": true }, "node_modules/@types/semver": { - "version": "7.5.6", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.6.tgz", - "integrity": "sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==", + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", "dev": true }, "node_modules/@types/vinyl": { @@ -982,16 +982,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.19.0.tgz", - "integrity": "sha512-DUCUkQNklCQYnrBSSikjVChdc84/vMPDQSgJTHBZ64G9bA9w0Crc0rd2diujKbTdp6w2J47qkeHQLoi0rpLCdg==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.3.1.tgz", + "integrity": "sha512-STEDMVQGww5lhCuNXVSQfbfuNII5E08QWkvAw5Qwf+bj2WT+JkG1uc+5/vXA3AOYMDHVOSpL+9rcbEUiHIm2dw==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.19.0", - "@typescript-eslint/type-utils": "6.19.0", - "@typescript-eslint/utils": "6.19.0", - "@typescript-eslint/visitor-keys": "6.19.0", + "@typescript-eslint/scope-manager": "7.3.1", + "@typescript-eslint/type-utils": "7.3.1", + "@typescript-eslint/utils": "7.3.1", + "@typescript-eslint/visitor-keys": "7.3.1", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -1000,15 +1000,15 @@ "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", - "eslint": "^7.0.0 || ^8.0.0" + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -1016,75 +1016,28 @@ } } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.19.0.tgz", - "integrity": "sha512-dO1XMhV2ehBI6QN8Ufi7I10wmUovmLU0Oru3n5LVlM2JuzB4M+dVphCPLkVpKvGij2j/pHBWuJ9piuXx+BhzxQ==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "6.19.0", - "@typescript-eslint/visitor-keys": "6.19.0" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/types": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.19.0.tgz", - "integrity": "sha512-lFviGV/vYhOy3m8BJ/nAKoAyNhInTdXpftonhWle66XHAtT1ouBlkjL496b5H5hb8dWXHwtypTqgtb/DEa+j5A==", - "dev": true, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.19.0.tgz", - "integrity": "sha512-hZaUCORLgubBvtGpp1JEFEazcuEdfxta9j4iUwdSAr7mEsYYAp3EAUyCZk3VEEqGj6W+AV4uWyrDGtrlawAsgQ==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "6.19.0", - "eslint-visitor-keys": "^3.4.1" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/@typescript-eslint/parser": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.1.0.tgz", - "integrity": "sha512-hIzCPvX4vDs4qL07SYzyomamcs2/tQYXg5DtdAfj35AyJ5PIUqhsLf4YrEIFzZcND7R2E8tpQIZKayxg8/6Wbw==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.3.1.tgz", + "integrity": "sha512-Rq49+pq7viTRCH48XAbTA+wdLRrB/3sRq4Lpk0oGDm0VmnjBrAOVXH/Laalmwsv2VpekiEfVFwJYVk6/e8uvQw==", "dev": true, "peer": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.1.0", - "@typescript-eslint/types": "6.1.0", - "@typescript-eslint/typescript-estree": "6.1.0", - "@typescript-eslint/visitor-keys": "6.1.0", + "@typescript-eslint/scope-manager": "7.3.1", + "@typescript-eslint/types": "7.3.1", + "@typescript-eslint/typescript-estree": "7.3.1", + "@typescript-eslint/visitor-keys": "7.3.1", "debug": "^4.3.4" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -1093,17 +1046,16 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.1.0.tgz", - "integrity": "sha512-AxjgxDn27hgPpe2rQe19k0tXw84YCOsjDJ2r61cIebq1t+AIxbgiXKvD4999Wk49GVaAcdJ/d49FYel+Pp3jjw==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.3.1.tgz", + "integrity": "sha512-fVS6fPxldsKY2nFvyT7IP78UO1/I2huG+AYu5AMjCT9wtl6JFiDnsv4uad4jQ0GTFzcUV5HShVeN96/17bTBag==", "dev": true, - "peer": true, "dependencies": { - "@typescript-eslint/types": "6.1.0", - "@typescript-eslint/visitor-keys": "6.1.0" + "@typescript-eslint/types": "7.3.1", + "@typescript-eslint/visitor-keys": "7.3.1" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -1111,25 +1063,25 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.19.0.tgz", - "integrity": "sha512-mcvS6WSWbjiSxKCwBcXtOM5pRkPQ6kcDds/juxcy/727IQr3xMEcwr/YLHW2A2+Fp5ql6khjbKBzOyjuPqGi/w==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.3.1.tgz", + "integrity": "sha512-iFhaysxFsMDQlzJn+vr3OrxN8NmdQkHks4WaqD4QBnt5hsq234wcYdyQ9uquzJJIDAj5W4wQne3yEsYA6OmXGw==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.19.0", - "@typescript-eslint/utils": "6.19.0", + "@typescript-eslint/typescript-estree": "7.3.1", + "@typescript-eslint/utils": "7.3.1", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -1137,96 +1089,13 @@ } } }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/types": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.19.0.tgz", - "integrity": "sha512-lFviGV/vYhOy3m8BJ/nAKoAyNhInTdXpftonhWle66XHAtT1ouBlkjL496b5H5hb8dWXHwtypTqgtb/DEa+j5A==", - "dev": true, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.19.0.tgz", - "integrity": "sha512-o/zefXIbbLBZ8YJ51NlkSAt2BamrK6XOmuxSR3hynMIzzyMY33KuJ9vuMdFSXW+H0tVvdF9qBPTHA91HDb4BIQ==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "6.19.0", - "@typescript-eslint/visitor-keys": "6.19.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "minimatch": "9.0.3", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" - }, - "engines": { - "node": "^16.0.0 || >=18.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": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.19.0.tgz", - "integrity": "sha512-hZaUCORLgubBvtGpp1JEFEazcuEdfxta9j4iUwdSAr7mEsYYAp3EAUyCZk3VEEqGj6W+AV4uWyrDGtrlawAsgQ==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "6.19.0", - "eslint-visitor-keys": "^3.4.1" - }, - "engines": { - "node": "^16.0.0 || >=18.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.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", - "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/types": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.1.0.tgz", - "integrity": "sha512-+Gfd5NHCpDoHDOaU/yIF3WWRI2PcBRKKpP91ZcVbL0t5tQpqYWBs3z/GGhvU+EV1D0262g9XCnyqQh19prU0JQ==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.3.1.tgz", + "integrity": "sha512-2tUf3uWggBDl4S4183nivWQ2HqceOZh1U4hhu4p1tPiIJoRRXrab7Y+Y0p+dozYwZVvLPRI6r5wKe9kToF9FIw==", "dev": true, - "peer": true, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -1234,96 +1103,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.1.0.tgz", - "integrity": "sha512-nUKAPWOaP/tQjU1IQw9sOPCDavs/iU5iYLiY/6u7gxS7oKQoi4aUxXS1nrrVGTyBBaGesjkcwwHkbkiD5eBvcg==", - "dev": true, - "peer": true, - "dependencies": { - "@typescript-eslint/types": "6.1.0", - "@typescript-eslint/visitor-keys": "6.1.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/utils": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.19.0.tgz", - "integrity": "sha512-QR41YXySiuN++/dC9UArYOg4X86OAYP83OWTewpVx5ct1IZhjjgTLocj7QNxGhWoTqknsgpl7L+hGygCO+sdYw==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.3.1.tgz", + "integrity": "sha512-tLpuqM46LVkduWP7JO7yVoWshpJuJzxDOPYIVWUUZbW+4dBpgGeUdl/fQkhuV0A8eGnphYw3pp8d2EnvPOfxmQ==", "dev": true, "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@types/json-schema": "^7.0.12", - "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.19.0", - "@typescript-eslint/types": "6.19.0", - "@typescript-eslint/typescript-estree": "6.19.0", - "semver": "^7.5.4" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" - } - }, - "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/scope-manager": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.19.0.tgz", - "integrity": "sha512-dO1XMhV2ehBI6QN8Ufi7I10wmUovmLU0Oru3n5LVlM2JuzB4M+dVphCPLkVpKvGij2j/pHBWuJ9piuXx+BhzxQ==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "6.19.0", - "@typescript-eslint/visitor-keys": "6.19.0" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/types": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.19.0.tgz", - "integrity": "sha512-lFviGV/vYhOy3m8BJ/nAKoAyNhInTdXpftonhWle66XHAtT1ouBlkjL496b5H5hb8dWXHwtypTqgtb/DEa+j5A==", - "dev": true, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.19.0.tgz", - "integrity": "sha512-o/zefXIbbLBZ8YJ51NlkSAt2BamrK6XOmuxSR3hynMIzzyMY33KuJ9vuMdFSXW+H0tVvdF9qBPTHA91HDb4BIQ==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "6.19.0", - "@typescript-eslint/visitor-keys": "6.19.0", + "@typescript-eslint/types": "7.3.1", + "@typescript-eslint/visitor-keys": "7.3.1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -1332,7 +1118,7 @@ "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -1344,24 +1130,7 @@ } } }, - "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.19.0.tgz", - "integrity": "sha512-hZaUCORLgubBvtGpp1JEFEazcuEdfxta9j4iUwdSAr7mEsYYAp3EAUyCZk3VEEqGj6W+AV4uWyrDGtrlawAsgQ==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "6.19.0", - "eslint-visitor-keys": "^3.4.1" - }, - "engines": { - "node": "^16.0.0 || >=18.0.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==", @@ -1370,7 +1139,7 @@ "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.3", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", @@ -1385,18 +1154,42 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.1.0.tgz", - "integrity": "sha512-yQeh+EXhquh119Eis4k0kYhj9vmFzNpbhM3LftWQVwqVjipCkwHBQOZutcYW+JVkjtTG9k8nrZU1UoNedPDd1A==", + "node_modules/@typescript-eslint/utils": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.3.1.tgz", + "integrity": "sha512-jIERm/6bYQ9HkynYlNZvXpzmXWZGhMbrOvq3jJzOSOlKXsVjrrolzWBjDW6/TvT5Q3WqaN4EkmcfdQwi9tDjBQ==", "dev": true, - "peer": true, "dependencies": { - "@typescript-eslint/types": "6.1.0", + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "7.3.1", + "@typescript-eslint/types": "7.3.1", + "@typescript-eslint/typescript-estree": "7.3.1", + "semver": "^7.5.4" + }, + "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/visitor-keys": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.3.1.tgz", + "integrity": "sha512-9RMXwQF8knsZvfv9tdi+4D/j7dMG28X/wMJ8Jj6eOHyHWwDW4ngQJcqEczSsqIKKjFiLFr40Mnr7a5ulDD3vmw==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.3.1", "eslint-visitor-keys": "^3.4.1" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -4259,9 +4052,9 @@ "dev": true }, "node_modules/fast-glob": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", - "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -10822,12 +10615,12 @@ } }, "node_modules/ts-api-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.1.tgz", - "integrity": "sha512-lC/RGlPmwdrIBFTX59wwNzqh7aR2otPNPR/5brHZm/XKFYKsfqxihXUe9pU3JI+3vGkl+vyCoNNnPhJn3aLK1A==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", "dev": true, "engines": { - "node": ">=16.13.0" + "node": ">=16" }, "peerDependencies": { "typescript": ">=4.2.0" diff --git a/package.json b/package.json index ecfe593ce..2b9c602d4 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "@hyperjump/json-schema": "^1.5.0", "@microsoft/api-documenter": "^7.22.4", "@microsoft/api-extractor": "^7.29.5", - "@typescript-eslint/eslint-plugin": "^6.1.0", + "@typescript-eslint/eslint-plugin": "^7.3.1", "async-done": "^2.0.0", "chai": "^4.2.0", "concurrently": "^8.0.1", From 68b03d269d0310e3aa958a954303daeab0366956 Mon Sep 17 00:00:00 2001 From: dongjinlong <164888560+worrycare@users.noreply.github.com> Date: Tue, 26 Mar 2024 20:27:40 +0800 Subject: [PATCH 04/14] chore: remove repetitive words in comments (#7963) Signed-off-by: dongjinlong --- core/connection.ts | 2 +- core/render_management.ts | 2 +- core/xml.ts | 2 +- demos/blockfactory/block_definition_extractor.js | 2 +- scripts/migration/renamings.json5 | 2 +- tests/scripts/load.mjs | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/connection.ts b/core/connection.ts index 56ba4c3a5..7a8836822 100644 --- a/core/connection.ts +++ b/core/connection.ts @@ -222,7 +222,7 @@ export class Connection implements IASTNodeLocationWithBlock { * Connect this connection to another connection. * * @param otherConnection Connection to connect to. - * @returns Whether the the blocks are now connected or not. + * @returns Whether the blocks are now connected or not. */ connect(otherConnection: Connection): boolean { if (this.targetConnection === otherConnection) { diff --git a/core/render_management.ts b/core/render_management.ts index f0ec2a133..c9041aedc 100644 --- a/core/render_management.ts +++ b/core/render_management.ts @@ -155,7 +155,7 @@ function dequeueBlock(block: BlockSvg) { * No need to render dead blocks. * * No need to render blocks with parents. A render for the block may have been - * queued, and the the block was connected to a parent, so it is no longer a + * queued, and the block was connected to a parent, so it is no longer a * root block. Rendering will be triggered through the real root block. */ function shouldRenderRootBlock(block: BlockSvg): boolean { diff --git a/core/xml.ts b/core/xml.ts index ee72f526b..db75e04c9 100644 --- a/core/xml.ts +++ b/core/xml.ts @@ -899,7 +899,7 @@ function applyNextTagNodes( * * @param xmlBlock XML block element. * @param workspace The workspace. - * @param parentConnection The parent connection to to connect this block to + * @param parentConnection The parent connection to connect this block to * after instantiating. * @param connectedToParentNext Whether the provided parent connection is a next * connection, rather than output or statement. diff --git a/demos/blockfactory/block_definition_extractor.js b/demos/blockfactory/block_definition_extractor.js index e6b1cedd6..fa1aae775 100644 --- a/demos/blockfactory/block_definition_extractor.js +++ b/demos/blockfactory/block_definition_extractor.js @@ -71,7 +71,7 @@ BlockDefinitionExtractor.newDomElement_ = function(name, opt_attrs, opt_text) { * requested type. * * @param {string} type Type name of desired connection constraint. - * @return {!Element} The representing the the constraint type. + * @return {!Element} The representing the constraint type. * @private */ BlockDefinitionExtractor.buildBlockForType_ = function(type) { diff --git a/scripts/migration/renamings.json5 b/scripts/migration/renamings.json5 index bdbb2a132..9c51b2d4a 100644 --- a/scripts/migration/renamings.json5 +++ b/scripts/migration/renamings.json5 @@ -45,7 +45,7 @@ // The name that the export had before this version. // All of the properties on this object are optional. 'oldExportName': { - // The new module that the export is in in this version. If + // The new module that the export is in this version. If // this is not provided, the newModule is assumed to be the // parent module's newPath. newModule: 'new.module.name', diff --git a/tests/scripts/load.mjs b/tests/scripts/load.mjs index 728a4fd2c..f2238cf1c 100644 --- a/tests/scripts/load.mjs +++ b/tests/scripts/load.mjs @@ -68,7 +68,7 @@ export const COMPRESSED = compressed(); * * When loading in uncompressed mode, if scriptExports is a simple * variable name (e.g. 'Blockly') then globalThis[scriptExports] will - * be set to the the chunk's Module object. This attempts to provide + * be set to the chunk's Module object. This attempts to provide * backward compatibility with loading the compressed chunk as a * script, where this is done by the compressed chunk's UMD wrapper. * The compatibility is not complete, however: since Module objects From 35bce82587499a6b922a973a2c4bdf1360b7ac28 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Mar 2024 08:26:31 -0700 Subject: [PATCH 05/14] chore(deps-dev): Bump ip from 1.1.8 to 1.1.9 (#7876) Bumps [ip](https://github.com/indutny/node-ip) from 1.1.8 to 1.1.9. - [Commits](https://github.com/indutny/node-ip/compare/v1.1.8...v1.1.9) --- updated-dependencies: - dependency-name: ip dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index d633e70f5..0a60e46e0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6306,9 +6306,9 @@ } }, "node_modules/ip": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz", - "integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==", + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.9.tgz", + "integrity": "sha512-cyRxvOEpNHNtchU3Ln9KC/auJgup87llfQpQ+t5ghoC/UhL16SWzbueiCsdTnWmqAWl7LadfuwhlqmtOaqMHdQ==", "dev": true }, "node_modules/is-absolute": { @@ -9917,9 +9917,9 @@ } }, "node_modules/socks/node_modules/ip": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", - "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==", + "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": { From 2f4bea4ede43886e82bd7e403dd13d7f8740f214 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Mar 2024 08:27:00 -0700 Subject: [PATCH 06/14] chore(deps): Bump @microsoft/api-extractor from 7.38.5 to 7.43.0 (#7959) Bumps [@microsoft/api-extractor](https://github.com/microsoft/rushstack/tree/HEAD/apps/api-extractor) from 7.38.5 to 7.43.0. - [Changelog](https://github.com/microsoft/rushstack/blob/main/apps/api-extractor/CHANGELOG.md) - [Commits](https://github.com/microsoft/rushstack/commits/@microsoft/api-extractor_v7.43.0/apps/api-extractor) --- updated-dependencies: - dependency-name: "@microsoft/api-extractor" 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 | 159 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 134 insertions(+), 25 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0a60e46e0..54a2e24a3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -576,23 +576,24 @@ } }, "node_modules/@microsoft/api-extractor": { - "version": "7.38.5", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.38.5.tgz", - "integrity": "sha512-c/w2zfqBcBJxaCzpJNvFoouWewcYrUOfeu5ZkWCCIXTF9a/gXM85RGevEzlMAIEGM/kssAAZSXRJIZ3Q5vLFow==", + "version": "7.43.0", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.43.0.tgz", + "integrity": "sha512-GFhTcJpB+MI6FhvXEI9b2K0snulNLWHqC/BbcJtyNYcKUiw7l3Lgis5ApsYncJ0leALX7/of4XfmXk+maT111w==", "dev": true, "dependencies": { - "@microsoft/api-extractor-model": "7.28.3", + "@microsoft/api-extractor-model": "7.28.13", "@microsoft/tsdoc": "0.14.2", "@microsoft/tsdoc-config": "~0.16.1", - "@rushstack/node-core-library": "3.62.0", - "@rushstack/rig-package": "0.5.1", - "@rushstack/ts-command-line": "4.17.1", - "colors": "~1.2.1", + "@rushstack/node-core-library": "4.0.2", + "@rushstack/rig-package": "0.5.2", + "@rushstack/terminal": "0.10.0", + "@rushstack/ts-command-line": "4.19.1", "lodash": "~4.17.15", + "minimatch": "~3.0.3", "resolve": "~1.22.1", "semver": "~7.5.4", "source-map": "~0.6.1", - "typescript": "~5.0.4" + "typescript": "5.4.2" }, "bin": { "api-extractor": "bin/api-extractor" @@ -609,6 +610,72 @@ "@rushstack/node-core-library": "3.62.0" } }, + "node_modules/@microsoft/api-extractor/node_modules/@microsoft/api-extractor-model": { + "version": "7.28.13", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.28.13.tgz", + "integrity": "sha512-39v/JyldX4MS9uzHcdfmjjfS6cYGAoXV+io8B5a338pkHiSt+gy2eXQ0Q7cGFJ7quSa1VqqlMdlPrB6sLR/cAw==", + "dev": true, + "dependencies": { + "@microsoft/tsdoc": "0.14.2", + "@microsoft/tsdoc-config": "~0.16.1", + "@rushstack/node-core-library": "4.0.2" + } + }, + "node_modules/@microsoft/api-extractor/node_modules/@rushstack/node-core-library": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-4.0.2.tgz", + "integrity": "sha512-hyES82QVpkfQMeBMteQUnrhASL/KHPhd7iJ8euduwNJG4mu2GSOKybf0rOEjOm1Wz7CwJEUm9y0yD7jg2C1bfg==", + "dev": true, + "dependencies": { + "fs-extra": "~7.0.1", + "import-lazy": "~4.0.0", + "jju": "~1.4.0", + "resolve": "~1.22.1", + "semver": "~7.5.4", + "z-schema": "~5.0.2" + }, + "peerDependencies": { + "@types/node": "*" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@microsoft/api-extractor/node_modules/@rushstack/ts-command-line": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.19.1.tgz", + "integrity": "sha512-J7H768dgcpG60d7skZ5uSSwyCZs/S2HrWP1Ds8d1qYAyaaeJmpmmLr9BVw97RjFzmQPOYnoXcKA4GkqDCkduQg==", + "dev": true, + "dependencies": { + "@rushstack/terminal": "0.10.0", + "@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", + "integrity": "sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/@microsoft/api-extractor/node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -618,19 +685,6 @@ "node": ">=0.10.0" } }, - "node_modules/@microsoft/api-extractor/node_modules/typescript": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", - "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=12.20" - } - }, "node_modules/@microsoft/tsdoc": { "version": "0.14.2", "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.14.2.tgz", @@ -792,15 +846,70 @@ } }, "node_modules/@rushstack/rig-package": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.5.1.tgz", - "integrity": "sha512-pXRYSe29TjRw7rqxD4WS3HN/sRSbfr+tJs4a9uuaSIBAITbUggygdhuG0VrO0EO+QqH91GhYMN4S6KRtOEmGVA==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.5.2.tgz", + "integrity": "sha512-mUDecIJeH3yYGZs2a48k+pbhM6JYwWlgjs2Ca5f2n1G2/kgdgP9D/07oglEGf6mRyXEnazhEENeYTSNDRCwdqA==", "dev": true, "dependencies": { "resolve": "~1.22.1", "strip-json-comments": "~3.1.1" } }, + "node_modules/@rushstack/terminal": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@rushstack/terminal/-/terminal-0.10.0.tgz", + "integrity": "sha512-UbELbXnUdc7EKwfH2sb8ChqNgapUOdqcCIdQP4NGxBpTZV2sQyeekuK3zmfQSa/MN+/7b4kBogl2wq0vpkpYGw==", + "dev": true, + "dependencies": { + "@rushstack/node-core-library": "4.0.2", + "supports-color": "~8.1.1" + }, + "peerDependencies": { + "@types/node": "*" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@rushstack/terminal/node_modules/@rushstack/node-core-library": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-4.0.2.tgz", + "integrity": "sha512-hyES82QVpkfQMeBMteQUnrhASL/KHPhd7iJ8euduwNJG4mu2GSOKybf0rOEjOm1Wz7CwJEUm9y0yD7jg2C1bfg==", + "dev": true, + "dependencies": { + "fs-extra": "~7.0.1", + "import-lazy": "~4.0.0", + "jju": "~1.4.0", + "resolve": "~1.22.1", + "semver": "~7.5.4", + "z-schema": "~5.0.2" + }, + "peerDependencies": { + "@types/node": "*" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@rushstack/terminal/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/@rushstack/ts-command-line": { "version": "4.17.1", "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.17.1.tgz", From 2ea9e21e6d23814fe728ba5311a67c73814b2207 Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Tue, 26 Mar 2024 19:13:52 +0100 Subject: [PATCH 07/14] chore: Clean up variable assignment. (#7962) * chore: Clean up variable assignment. * fix: variable now const as a result of prev commit --- appengine/add_timestamps.py | 4 ++-- core/field_variable.ts | 1 - core/serialization/workspaces.ts | 3 +-- core/shortcut_registry.ts | 4 ++-- core/utils/svg_math.ts | 4 ++-- generators/javascript/math.ts | 4 ++-- scripts/i18n/js_to_json.py | 2 +- tests/generators/golden/generated.js | 4 ++-- tests/generators/unittest_dart.js | 2 +- tests/generators/unittest_javascript.js | 2 +- tests/generators/unittest_php.js | 2 +- tests/generators/unittest_python.js | 2 +- 12 files changed, 16 insertions(+), 18 deletions(-) diff --git a/appengine/add_timestamps.py b/appengine/add_timestamps.py index af877f3d6..05ff7b928 100644 --- a/appengine/add_timestamps.py +++ b/appengine/add_timestamps.py @@ -62,8 +62,8 @@ def run_query(): while more: results, cursor, more = query.fetch_page(PAGE_SIZE, start_cursor=cursor) handle_results(results) - page_count = page_count + 1 - result_count = result_count + len(results) + page_count += 1 + result_count += len(results) print(f'{datetime.datetime.now().strftime("%I:%M:%S %p")} : page {page_count} : {result_count}') run_query() diff --git a/core/field_variable.ts b/core/field_variable.ts index 95474e4b1..539557256 100644 --- a/core/field_variable.ts +++ b/core/field_variable.ts @@ -444,7 +444,6 @@ export class FieldVariable extends FieldDropdown { // #1499. // Set the allowable variable types. Null means all types on the workspace. if (Array.isArray(variableTypes)) { - variableTypes = variableTypes; // Make sure the default type is valid. let isInArray = false; for (let i = 0; i < variableTypes.length; i++) { diff --git a/core/serialization/workspaces.ts b/core/serialization/workspaces.ts index 07c909ccf..871060196 100644 --- a/core/serialization/workspaces.ts +++ b/core/serialization/workspaces.ts @@ -75,8 +75,7 @@ export function load( } // reverse() is destructive, so we have to re-reverse to correct the order. - for (let [name, deserializer] of deserializers.reverse()) { - name = name; + for (const [name, deserializer] of deserializers.reverse()) { const pluginState = state[name]; if (pluginState) { (deserializer as ISerializer)?.load(state[name], workspace); diff --git a/core/shortcut_registry.ts b/core/shortcut_registry.ts index 35f409b48..161a2ed14 100644 --- a/core/shortcut_registry.ts +++ b/core/shortcut_registry.ts @@ -287,7 +287,7 @@ export class ShortcutRegistry { } } if (serializedKey !== '' && e.keyCode) { - serializedKey = serializedKey + '+' + e.keyCode; + serializedKey += '+' + e.keyCode; } else if (e.keyCode) { serializedKey = String(e.keyCode); } @@ -335,7 +335,7 @@ export class ShortcutRegistry { } if (serializedKey !== '' && keyCode) { - serializedKey = serializedKey + '+' + keyCode; + serializedKey += '+' + keyCode; } else if (keyCode) { serializedKey = `${keyCode}`; } diff --git a/core/utils/svg_math.ts b/core/utils/svg_math.ts index 88d38f625..0444787ad 100644 --- a/core/utils/svg_math.ts +++ b/core/utils/svg_math.ts @@ -87,8 +87,8 @@ export function getInjectionDivXY(element: Element): Coordinate { let y = 0; while (element) { const xy = getRelativeXY(element); - x = x + xy.x; - y = y + xy.y; + x += xy.x; + y += xy.y; const classes = element.getAttribute('class') || ''; if ((' ' + classes + ' ').includes(' injectionDiv ')) { break; diff --git a/generators/javascript/math.ts b/generators/javascript/math.ts index e8ab2852f..238ad19a2 100644 --- a/generators/javascript/math.ts +++ b/generators/javascript/math.ts @@ -318,7 +318,7 @@ function ${generator.FUNCTION_NAME_PLACEHOLDER_}(values) { } for (var j = 0; j < counts.length; j++) { if (counts[j][1] === maxCount) { - modes.push(counts[j][0]); + modes.push(counts[j][0]); } } return modes; @@ -341,7 +341,7 @@ function ${generator.FUNCTION_NAME_PLACEHOLDER_}(numbers) { for (var j = 0; j < n; j++) { variance += Math.pow(numbers[j] - mean, 2); } - variance = variance / n; + variance /= n; return Math.sqrt(variance); } `, diff --git a/scripts/i18n/js_to_json.py b/scripts/i18n/js_to_json.py index c070f3408..53651935e 100755 --- a/scripts/i18n/js_to_json.py +++ b/scripts/i18n/js_to_json.py @@ -81,7 +81,7 @@ def main(): for line in infile: if line.startswith('///'): if description: - description = description + ' ' + line[3:].strip() + description += ' ' + line[3:].strip() else: description = line[3:].strip() else: diff --git a/tests/generators/golden/generated.js b/tests/generators/golden/generated.js index f8ac5651a..ec103f0ba 100644 --- a/tests/generators/golden/generated.js +++ b/tests/generators/golden/generated.js @@ -513,7 +513,7 @@ function mathModes(values) { } for (var j = 0; j < counts.length; j++) { if (counts[j][1] === maxCount) { - modes.push(counts[j][0]); + modes.push(counts[j][0]); } } return modes; @@ -527,7 +527,7 @@ function mathStandardDeviation(numbers) { for (var j = 0; j < n; j++) { variance += Math.pow(numbers[j] - mean, 2); } - variance = variance / n; + variance /= n; return Math.sqrt(variance); } diff --git a/tests/generators/unittest_dart.js b/tests/generators/unittest_dart.js index 312a8fcc2..89f355389 100644 --- a/tests/generators/unittest_dart.js +++ b/tests/generators/unittest_dart.js @@ -154,7 +154,7 @@ dartGenerator.forBlock['unittest_adjustindex'] = function(block) { return [Number(index) + 1, dartGenerator.ORDER_ATOMIC]; } else { // If the index is dynamic, adjust it in code. - index = index + ' + 1'; + index += ' + 1'; } } else if (Blockly.utils.string.isNumber(index)) { return [index, dartGenerator.ORDER_ATOMIC]; diff --git a/tests/generators/unittest_javascript.js b/tests/generators/unittest_javascript.js index 279244eb2..77953a37a 100644 --- a/tests/generators/unittest_javascript.js +++ b/tests/generators/unittest_javascript.js @@ -158,7 +158,7 @@ javascriptGenerator.forBlock['unittest_adjustindex'] = function(block) { return [Number(index) + 1, javascriptGenerator.ORDER_ATOMIC]; } else { // If the index is dynamic, adjust it in code. - index = index + ' + 1'; + index += ' + 1'; } } else if (Blockly.utils.string.isNumber(index)) { return [index, javascriptGenerator.ORDER_ATOMIC]; diff --git a/tests/generators/unittest_php.js b/tests/generators/unittest_php.js index 408960d82..aedd7e6a1 100644 --- a/tests/generators/unittest_php.js +++ b/tests/generators/unittest_php.js @@ -145,7 +145,7 @@ phpGenerator.forBlock['unittest_adjustindex'] = function(block) { return [Number(index) + 1, phpGenerator.ORDER_ATOMIC]; } else { // If the index is dynamic, adjust it in code. - index = index + ' + 1'; + index += ' + 1'; } } else if (Blockly.utils.string.isNumber(index)) { return [index, phpGenerator.ORDER_ATOMIC]; diff --git a/tests/generators/unittest_python.js b/tests/generators/unittest_python.js index ba29015f9..49f8c9100 100644 --- a/tests/generators/unittest_python.js +++ b/tests/generators/unittest_python.js @@ -129,7 +129,7 @@ pythonGenerator.forBlock['unittest_adjustindex'] = function(block) { return [Number(index) + 1, pythonGenerator.ORDER_ATOMIC]; } else { // If the index is dynamic, adjust it in code. - index = index + ' + 1'; + index += ' + 1'; } } else if (Blockly.utils.string.isNumber(index)) { return [index, pythonGenerator.ORDER_ATOMIC]; From d9ea9b7f44b021186654a153c14c80ce0057e048 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Mar 2024 13:21:20 -0700 Subject: [PATCH 08/14] chore(deps): Bump google-github-actions/deploy-appengine (#7814) Bumps [google-github-actions/deploy-appengine](https://github.com/google-github-actions/deploy-appengine) from 2.0.0 to 2.1.0. - [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.0.0...v2.1.0) --- updated-dependencies: - dependency-name: google-github-actions/deploy-appengine dependency-type: direct:production update-type: version-update:semver-minor ... 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 72cee90bf..f7098d53a 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.0.0 + uses: google-github-actions/deploy-appengine@v2.1.0 # For parameters see: # https://github.com/google-github-actions/deploy-appengine#inputs with: From 82972bed76eeabbadaa0b1adf47c137ee8f60d03 Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Thu, 28 Mar 2024 23:52:45 +0100 Subject: [PATCH 09/14] chore: Remove colour blocks from code demo. (#7973) The colour-picker is leaving core. Removing the colour blocks means that any stored programs that use colour blocks will no longer load. However, since the code demo has no visual output, the colour blocks serve no use. --- demos/code/index.html | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/demos/code/index.html b/demos/code/index.html index a1a8661ec..d8f894607 100644 --- a/demos/code/index.html +++ b/demos/code/index.html @@ -350,44 +350,6 @@ - - - - - - - 100 - - - - - 50 - - - - - 0 - - - - - - - #ff0000 - - - - - #3333ff - - - - - 0.5 - - - - From 5a6f22f0f3797a2ee4949273bd124d7ed321f3a1 Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Thu, 28 Mar 2024 23:53:57 +0100 Subject: [PATCH 10/14] feat!: Throw errors on missing inputs (#7969) Previously generators could generate code from inputs that didn't exist and get back the empty string. This silent failure was causing problems for diagnosing issues. This PR changes the behaviour so that an error is thrown. This will break generators which rely on the previous behaviour. Several of our demo blocks needed editing to accomodate this change. Resolves #7665 --- core/generator.ts | 6 ++++++ generators/dart/procedures.ts | 13 +++++++++++-- generators/dart/text.ts | 10 ++++++---- generators/javascript/procedures.ts | 13 +++++++++++-- generators/lua/procedures.ts | 13 +++++++++++-- generators/lua/text.ts | 4 ++-- generators/php/procedures.ts | 13 +++++++++++-- generators/python/procedures.ts | 13 +++++++++++-- 8 files changed, 69 insertions(+), 16 deletions(-) diff --git a/core/generator.ts b/core/generator.ts index c7c26f15f..f948924d9 100644 --- a/core/generator.ts +++ b/core/generator.ts @@ -313,6 +313,9 @@ export class CodeGenerator { throw TypeError('Expecting valid order from block: ' + block.type); } const targetBlock = block.getInputTargetBlock(name); + if (!targetBlock && !block.getInput(name)) { + throw ReferenceError(`Input "${name}" doesn't exist on "${block.type}"`); + } if (!targetBlock) { return ''; } @@ -391,6 +394,9 @@ export class CodeGenerator { */ statementToCode(block: Block, name: string): string { const targetBlock = block.getInputTargetBlock(name); + if (!targetBlock && !block.getInput(name)) { + throw ReferenceError(`Input "${name}" doesn't exist on "${block.type}"`); + } let code = this.blockToCode(targetBlock); // Value blocks must return code and order of operations info. // Statement blocks must only return code. diff --git a/generators/dart/procedures.ts b/generators/dart/procedures.ts index 5102432ad..0ecf6d210 100644 --- a/generators/dart/procedures.ts +++ b/generators/dart/procedures.ts @@ -35,8 +35,17 @@ export function procedures_defreturn(block: Block, generator: DartGenerator) { generator.INDENT, ); } - const branch = generator.statementToCode(block, 'STACK'); - let returnValue = generator.valueToCode(block, 'RETURN', Order.NONE) || ''; + let branch = ''; + if (block.getInput('STACK')) { + // The 'procedures_defreturn' block might not have a STACK input. + branch = generator.statementToCode(block, 'STACK'); + } + let returnValue = ''; + if (block.getInput('RETURN')) { + // The 'procedures_defnoreturn' block (which shares this code) + // does not have a RETURN input. + returnValue = generator.valueToCode(block, 'RETURN', Order.NONE) || ''; + } let xfix2 = ''; if (branch && returnValue) { // After executing the function body, revisit this block for the return. diff --git a/generators/dart/text.ts b/generators/dart/text.ts index 501619e03..6bb2bea82 100644 --- a/generators/dart/text.ts +++ b/generators/dart/text.ts @@ -128,10 +128,12 @@ export function text_charAt( return [code, Order.UNARY_POSTFIX]; } case 'LAST': - at = 1; - // Fall through. case 'FROM_END': { - at = generator.getAdjusted(block, 'AT', 1); + if (where === 'LAST') { + at = 1; + } else { + at = generator.getAdjusted(block, 'AT', 1); + } const functionName = generator.provideFunction_( 'text_get_from_end', ` @@ -140,7 +142,7 @@ String ${generator.FUNCTION_NAME_PLACEHOLDER_}(String text, num x) { } `, ); - const code = functionName + '(' + text + ', ' + at + ')'; + const code = `${functionName}(${text}, ${at})`; return [code, Order.UNARY_POSTFIX]; } case 'RANDOM': { diff --git a/generators/javascript/procedures.ts b/generators/javascript/procedures.ts index a835271e7..e0a055217 100644 --- a/generators/javascript/procedures.ts +++ b/generators/javascript/procedures.ts @@ -38,8 +38,17 @@ export function procedures_defreturn( generator.INDENT, ); } - const branch = generator.statementToCode(block, 'STACK'); - let returnValue = generator.valueToCode(block, 'RETURN', Order.NONE) || ''; + let branch = ''; + if (block.getInput('STACK')) { + // The 'procedures_defreturn' block might not have a STACK input. + branch = generator.statementToCode(block, 'STACK'); + } + let returnValue = ''; + if (block.getInput('RETURN')) { + // The 'procedures_defnoreturn' block (which shares this code) + // does not have a RETURN input. + returnValue = generator.valueToCode(block, 'RETURN', Order.NONE) || ''; + } let xfix2 = ''; if (branch && returnValue) { // After executing the function body, revisit this block for the return. diff --git a/generators/lua/procedures.ts b/generators/lua/procedures.ts index 07003aee9..79dc58aa2 100644 --- a/generators/lua/procedures.ts +++ b/generators/lua/procedures.ts @@ -38,8 +38,17 @@ export function procedures_defreturn( generator.INDENT, ); } - let branch = generator.statementToCode(block, 'STACK'); - let returnValue = generator.valueToCode(block, 'RETURN', Order.NONE) || ''; + let branch = ''; + if (block.getInput('STACK')) { + // The 'procedures_defreturn' block might not have a STACK input. + branch = generator.statementToCode(block, 'STACK'); + } + let returnValue = ''; + if (block.getInput('RETURN')) { + // The 'procedures_defnoreturn' block (which shares this code) + // does not have a RETURN input. + returnValue = generator.valueToCode(block, 'RETURN', Order.NONE) || ''; + } let xfix2 = ''; if (branch && returnValue) { // After executing the function body, revisit this block for the return. diff --git a/generators/lua/text.ts b/generators/lua/text.ts index defbbaf99..350b86313 100644 --- a/generators/lua/text.ts +++ b/generators/lua/text.ts @@ -132,8 +132,6 @@ export function text_charAt( // Get letter at index. // Note: Until January 2013 this block did not have the WHERE input. const where = block.getFieldValue('WHERE') || 'FROM_START'; - const atOrder = where === 'FROM_END' ? Order.UNARY : Order.NONE; - const at = generator.valueToCode(block, 'AT', atOrder) || '1'; const text = generator.valueToCode(block, 'VALUE', Order.NONE) || "''"; let code; if (where === 'RANDOM') { @@ -154,6 +152,8 @@ end } else if (where === 'LAST') { start = '-1'; } else { + const atOrder = where === 'FROM_END' ? Order.UNARY : Order.NONE; + const at = generator.valueToCode(block, 'AT', atOrder) || '1'; if (where === 'FROM_START') { start = at; } else if (where === 'FROM_END') { diff --git a/generators/php/procedures.ts b/generators/php/procedures.ts index bd114cd0d..acf84aea6 100644 --- a/generators/php/procedures.ts +++ b/generators/php/procedures.ts @@ -60,8 +60,17 @@ export function procedures_defreturn(block: Block, generator: PhpGenerator) { generator.INDENT, ); } - const branch = generator.statementToCode(block, 'STACK'); - let returnValue = generator.valueToCode(block, 'RETURN', Order.NONE) || ''; + let branch = ''; + if (block.getInput('STACK')) { + // The 'procedures_defreturn' block might not have a STACK input. + branch = generator.statementToCode(block, 'STACK'); + } + let returnValue = ''; + if (block.getInput('RETURN')) { + // The 'procedures_defnoreturn' block (which shares this code) + // does not have a RETURN input. + returnValue = generator.valueToCode(block, 'RETURN', Order.NONE) || ''; + } let xfix2 = ''; if (branch && returnValue) { // After executing the function body, revisit this block for the return. diff --git a/generators/python/procedures.ts b/generators/python/procedures.ts index 798d6d55a..51d2ee9a3 100644 --- a/generators/python/procedures.ts +++ b/generators/python/procedures.ts @@ -60,8 +60,17 @@ export function procedures_defreturn(block: Block, generator: PythonGenerator) { generator.INDENT, ); } - let branch = generator.statementToCode(block, 'STACK'); - let returnValue = generator.valueToCode(block, 'RETURN', Order.NONE) || ''; + let branch = ''; + if (block.getInput('STACK')) { + // The 'procedures_defreturn' block might not have a STACK input. + branch = generator.statementToCode(block, 'STACK'); + } + let returnValue = ''; + if (block.getInput('RETURN')) { + // The 'procedures_defnoreturn' block (which shares this code) + // does not have a RETURN input. + returnValue = generator.valueToCode(block, 'RETURN', Order.NONE) || ''; + } let xfix2 = ''; if (branch && returnValue) { // After executing the function body, revisit this block for the return. From 6767717d0bf53ed93799a39728bf1677a3d26934 Mon Sep 17 00:00:00 2001 From: Maribeth Bottorff Date: Mon, 1 Apr 2024 14:13:25 -0700 Subject: [PATCH 11/14] feat: allow duplicate registry values (#7988) --- core/registry.ts | 9 +++++++-- tests/mocha/registry_test.js | 9 +++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/core/registry.ts b/core/registry.ts index 3645a6fdf..727711d48 100644 --- a/core/registry.ts +++ b/core/registry.ts @@ -162,8 +162,13 @@ export function register( // Validate that the given class has all the required properties. validate(type, registryItem); - // Don't throw an error if opt_allowOverrides is true. - if (!opt_allowOverrides && typeRegistry[caselessName]) { + // Don't throw an error if opt_allowOverrides is true, + // or if we're trying to register the same item. + if ( + !opt_allowOverrides && + typeRegistry[caselessName] && + typeRegistry[caselessName] !== registryItem + ) { throw Error( 'Name "' + caselessName + diff --git a/tests/mocha/registry_test.js b/tests/mocha/registry_test.js index fd37c6e69..b562606f4 100644 --- a/tests/mocha/registry_test.js +++ b/tests/mocha/registry_test.js @@ -47,6 +47,15 @@ suite('Registry', function () { test('Overwrite a Key', function () { Blockly.registry.register('test', 'test_name', TestClass); chai.assert.throws(function () { + // Registers a different object under the same name + Blockly.registry.register('test', 'test_name', {}); + }, 'already registered'); + }); + + test('Register a Duplicate Item', function () { + Blockly.registry.register('test', 'test_name', TestClass); + chai.assert.doesNotThrow(function () { + // Registering the same object under the same name is allowed Blockly.registry.register('test', 'test_name', TestClass); }, 'already registered'); }); From f547fad3625beff4720d0086db03375f83f5f327 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 14:45:24 -0700 Subject: [PATCH 12/14] chore(deps): Bump typescript from 5.4.2 to 5.4.3 (#7985) Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.4.2 to 5.4.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.4.2...v5.4.3) --- 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 | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 54a2e24a3..36b713c6d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -685,6 +685,19 @@ "node": ">=0.10.0" } }, + "node_modules/@microsoft/api-extractor/node_modules/typescript": { + "version": "5.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", + "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/@microsoft/tsdoc": { "version": "0.14.2", "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.14.2.tgz", @@ -10787,9 +10800,9 @@ "dev": true }, "node_modules/typescript": { - "version": "5.4.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", - "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.3.tgz", + "integrity": "sha512-KrPd3PKaCLr78MalgiwJnA25Nm8HAmdwN3mYUYZgG/wizIo9EainNVQI9/yDavtVFRN2h3k8uf3GLHuhDMgEHg==", "dev": true, "bin": { "tsc": "bin/tsc", From 518fc67ec52340d896f79bbc5241e151e177778c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 14:45:54 -0700 Subject: [PATCH 13/14] chore(deps): Bump @blockly/dev-tools from 7.1.5 to 7.1.7 (#7986) Bumps [@blockly/dev-tools](https://github.com/google/blockly-samples/tree/HEAD/plugins/dev-tools) from 7.1.5 to 7.1.7. - [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@7.1.7/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 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 36b713c6d..1b8f96d73 100644 --- a/package-lock.json +++ b/package-lock.json @@ -87,14 +87,14 @@ } }, "node_modules/@blockly/dev-tools": { - "version": "7.1.5", - "resolved": "https://registry.npmjs.org/@blockly/dev-tools/-/dev-tools-7.1.5.tgz", - "integrity": "sha512-eNpi+yknoR2RXzYUOE4Owp5XiY9Qm/FH+BOGhd5WrDyK3/LGQ4Yp0NOBO1tWN+Kbjxe19k6yhA50kX7YkDad/w==", + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/@blockly/dev-tools/-/dev-tools-7.1.7.tgz", + "integrity": "sha512-ar/6A7JyTSzhJ6ojEOzoCxnm4jRTQJeYn87g+iTEJrM9K8tk/Ccn4sZY34T+ULhy8A2MbFkbtmERCLx6HNrAkA==", "dev": true, "dependencies": { - "@blockly/block-test": "^5.0.4", + "@blockly/block-test": "^5.1.0", "@blockly/theme-dark": "^6.0.5", - "@blockly/theme-deuteranopia": "^5.0.5", + "@blockly/theme-deuteranopia": "^5.0.6", "@blockly/theme-highcontrast": "^5.0.5", "@blockly/theme-tritanopia": "^5.0.5", "chai": "^4.2.0", @@ -124,9 +124,9 @@ } }, "node_modules/@blockly/theme-deuteranopia": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/@blockly/theme-deuteranopia/-/theme-deuteranopia-5.0.5.tgz", - "integrity": "sha512-Eqr3JbIch4Uyi3awWXq0vtGy5LL4cknkBH4VjUi73w9Xdiytt1LgoWJD23NBtKcP4M31iDWV+8fdPK4R1tUVcg==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/@blockly/theme-deuteranopia/-/theme-deuteranopia-5.0.6.tgz", + "integrity": "sha512-bYQz2TrkbwPxYjZXlQGf6pMEnSBD/If4FtBqAavt/lutwib0awM0NbPWu8RP89z4aRcAlsByYYSzFQMNqYBaiA==", "dev": true, "engines": { "node": ">=8.17.0" From d56f52cb0aebaeead987a2b92e2b225b2168bba5 Mon Sep 17 00:00:00 2001 From: Alejandro Ramos <69006987+lotusotho@users.noreply.github.com> Date: Mon, 1 Apr 2024 23:54:54 +0200 Subject: [PATCH 14/14] fix: Assign to containerDiv blockyWidgetDiv if it already exists (#7980) * fix: assign to containerDiv if it already exists * Delete unused return * Fix if statement * format file using Prettier * Deduplicate lines and improve efficiency --- core/widgetdiv.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/widgetdiv.ts b/core/widgetdiv.ts index 52816f363..e03cf0b25 100644 --- a/core/widgetdiv.ts +++ b/core/widgetdiv.ts @@ -57,14 +57,16 @@ export function testOnly_setDiv(newDiv: HTMLDivElement | null) { * Create the widget div and inject it onto the page. */ export function createDom() { + const container = common.getParentContainer() || document.body; + if (document.querySelector('.' + containerClassName)) { - return; // Already created. + containerDiv = document.querySelector('.' + containerClassName); + } else { + containerDiv = document.createElement('div') as HTMLDivElement; + containerDiv.className = containerClassName; } - containerDiv = document.createElement('div') as HTMLDivElement; - containerDiv.className = containerClassName; - const container = common.getParentContainer() || document.body; - container.appendChild(containerDiv); + container.appendChild(containerDiv!); } /**