From a17c86ea7c8e914c8de968b3a9b282e3c2e20ecb Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Wed, 29 Mar 2023 17:12:05 +0000 Subject: [PATCH 1/3] release: Update version number to 9.3.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 312e2a9e0..4fc6c75cb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "blockly", - "version": "9.2.1", + "version": "9.3.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "blockly", - "version": "9.2.1", + "version": "9.3.0", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index 956162a95..f17a4235b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "blockly", - "version": "9.2.1", + "version": "9.3.0", "description": "Blockly is a library for building visual programming editors.", "keywords": [ "blockly" From 8e1890a93c9d52118f61bdb600baf73043fb51c7 Mon Sep 17 00:00:00 2001 From: Maribeth Bottorff Date: Thu, 30 Mar 2023 13:32:57 -0700 Subject: [PATCH 2/3] fix: allow splicing into shadow block stacks (#6939) * fix: allow splicing into shadow block stacks * chore: format (cherry picked from commit 69afe5b60fe43b5ed911db91ae62058d66ffe5ec) --- core/connection_checker.ts | 5 +++-- tests/mocha/connection_checker_test.js | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/core/connection_checker.ts b/core/connection_checker.ts index 599da547f..662037a93 100644 --- a/core/connection_checker.ts +++ b/core/connection_checker.ts @@ -250,8 +250,9 @@ export class ConnectionChecker implements IConnectionChecker { } // Don't offer to splice into a stack where the connected block is - // immovable. - if (b.targetBlock() && !b.targetBlock()!.isMovable()) { + // immovable, unless the block is a shadow block. + if (b.targetBlock() && !b.targetBlock()!.isMovable() && + !b.targetBlock()!.isShadow()) { return false; } break; diff --git a/tests/mocha/connection_checker_test.js b/tests/mocha/connection_checker_test.js index 11b9545c1..918476ece 100644 --- a/tests/mocha/connection_checker_test.js +++ b/tests/mocha/connection_checker_test.js @@ -367,6 +367,31 @@ suite('Connection checker', function() { 'Should connect two compatible stack blocks'); }); + test('Connect to unmovable shadow block', function() { + // Remove original test blocks. + this.workspace.clear(); + + // Add the same test blocks, but this time block B is a shadow block. + Blockly.Xml.domToWorkspace(Blockly.utils.xml.textToDom(` + + + + + + + + `), this.workspace); + [this.blockA, this.blockB, this.blockC] = this.workspace.getAllBlocks(true); + + // Try to connect blockC into the input connection of blockA, replacing blockB. + // This is allowed because shadow blocks can always be replaced, even though + // they are unmovable. + chai.assert.isTrue( + this.checker.doDragChecks( + this.blockC.previousConnection, this.blockA.nextConnection, 9000), + 'Should connect in place of a shadow block'); + }); + test('Do not splice into unmovable stack', function() { // Try to connect blockC above blockB. It shouldn't work because B is not movable // and is already connected to A's nextConnection. From 15b83d42db3803ade32f4c1fcd90743a07d83ab1 Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Thu, 30 Mar 2023 20:45:03 +0000 Subject: [PATCH 3/3] release: Update version number to 9.3.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 4fc6c75cb..aa62e50ef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "blockly", - "version": "9.3.0", + "version": "9.3.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "blockly", - "version": "9.3.0", + "version": "9.3.1", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index f17a4235b..ed1d14fa5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "blockly", - "version": "9.3.0", + "version": "9.3.1", "description": "Blockly is a library for building visual programming editors.", "keywords": [ "blockly"