From 3c2e8938bf4b334af580e6dbeacfa9f3c12c86de Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Thu, 10 Nov 2022 17:17:55 +0000 Subject: [PATCH 1/7] release: Update version number to 9.1.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 d8c7e4b14..37043f486 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "blockly", - "version": "9.0.1", + "version": "9.1.0-beta.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "blockly", - "version": "9.0.1", + "version": "9.1.0-beta.0", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index 36f2c88a5..77f601c9a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "blockly", - "version": "9.0.1", + "version": "9.1.0-beta.0", "description": "Blockly is a library for building visual programming editors.", "keywords": [ "blockly" From 21077ee7b0b197cdcb017266f49d77e229ec21aa Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Fri, 11 Nov 2022 17:42:33 +0000 Subject: [PATCH 2/7] fix(build): Put build products in correct location for AppEngine --- scripts/gulpfiles/appengine_tasks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gulpfiles/appengine_tasks.js b/scripts/gulpfiles/appengine_tasks.js index ea5b6a53a..88e0ba145 100644 --- a/scripts/gulpfiles/appengine_tasks.js +++ b/scripts/gulpfiles/appengine_tasks.js @@ -52,7 +52,7 @@ function copyStaticSrc(done) { */ function copyBuilt(done) { return gulp.src(['build/msg/**/*', 'dist/*_compressed.js*'], {base: '.'}) - .pipe(gulp.dest(demoTmpDir)); + .pipe(gulp.dest(demoStaticTmpDir)); } /** From a6bc9035ceadf1b5afa628a315fd874ba46f8112 Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Mon, 14 Nov 2022 11:16:11 -0800 Subject: [PATCH 3/7] chore: add 'fixes' to PR template (#6616) --- .github/PULL_REQUEST_TEMPLATE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index d26d698d7..0cf78b1ce 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -16,6 +16,7 @@ ### Resolves +Fixes ### Proposed Changes From b7bb48b56fe81860165e96faf9d8c87c8bd277cb Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Tue, 15 Nov 2022 18:56:19 +0000 Subject: [PATCH 4/7] release: Update version number to 9.1.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 37043f486..a76740e90 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "blockly", - "version": "9.1.0-beta.0", + "version": "9.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "blockly", - "version": "9.1.0-beta.0", + "version": "9.1.0", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index 77f601c9a..bd6b5fe4e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "blockly", - "version": "9.1.0-beta.0", + "version": "9.1.0", "description": "Blockly is a library for building visual programming editors.", "keywords": [ "blockly" From 441c24bf8b5c9d8bf0ed01f932ba460914e954ea Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Fri, 18 Nov 2022 15:26:16 -0800 Subject: [PATCH 5/7] fix: make mutator workspace public (#6634) * fix: make mutator workspace public * fix: make workspace private again --- core/mutator.ts | 54 ++++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/core/mutator.ts b/core/mutator.ts index 6cba64777..498608967 100644 --- a/core/mutator.ts +++ b/core/mutator.ts @@ -44,8 +44,12 @@ import type {WorkspaceSvg} from './workspace_svg.js'; export class Mutator extends Icon { private quarkNames: string[]; - /** Workspace in the mutator's bubble. */ - private workspace: WorkspaceSvg|null = null; + /** + * Workspace in the mutator's bubble. + * Due to legacy code in procedure block definitions, this name + * cannot change. + */ + private workspace_: WorkspaceSvg|null = null; /** Width of workspace. */ private workspaceWidth = 0; @@ -107,7 +111,7 @@ export class Mutator extends Icon { * @internal */ getWorkspace(): WorkspaceSvg|null { - return this.workspace; + return this.workspace_; } /** @@ -200,22 +204,22 @@ export class Mutator extends Icon { if (hasFlyout) { workspaceOptions.languageTree = toolbox.convertToolboxDefToJson(quarkXml); } - this.workspace = this.newWorkspaceSvg(workspaceOptions); - this.workspace.internalIsMutator = true; - this.workspace.addChangeListener(eventUtils.disableOrphans); + this.workspace_ = this.newWorkspaceSvg(workspaceOptions); + this.workspace_.internalIsMutator = true; + this.workspace_.addChangeListener(eventUtils.disableOrphans); // Mutator flyouts go inside the mutator workspace's rather than in // a top level SVG. Instead of handling scale themselves, mutators // inherit scale from the parent workspace. // To fix this, scale needs to be applied at a different level in the DOM. - const flyoutSvg = hasFlyout ? this.workspace.addFlyout(Svg.G) : null; - const background = this.workspace.createDom('blocklyMutatorBackground'); + const flyoutSvg = hasFlyout ? this.workspace_.addFlyout(Svg.G) : null; + const background = this.workspace_.createDom('blocklyMutatorBackground'); if (flyoutSvg) { // Insert the flyout after the but before the block canvas so that // the flyout is underneath in z-order. This makes blocks layering during // dragging work properly. - background.insertBefore(flyoutSvg, this.workspace.svgBlockCanvas_); + background.insertBefore(flyoutSvg, this.workspace_.svgBlockCanvas_); } this.svgDialog.appendChild(background); @@ -253,15 +257,15 @@ export class Mutator extends Icon { /** Resize the bubble to match the size of the workspace. */ private resizeBubble() { // If the bubble exists, the workspace also exists. - if (!this.workspace) { + if (!this.workspace_) { return; } const doubleBorderWidth = 2 * Bubble.BORDER_WIDTH; - const canvas = this.workspace.getCanvas(); + const canvas = this.workspace_.getCanvas(); const workspaceSize = canvas.getBBox(); let width = workspaceSize.width + workspaceSize.x; let height = workspaceSize.height + doubleBorderWidth * 3; - const flyout = this.workspace.getFlyout(); + const flyout = this.workspace_.getFlyout(); if (flyout) { const flyoutScrollMetrics = flyout.getWorkspace().getMetricsManager().getScrollMetrics(); @@ -285,20 +289,20 @@ export class Mutator extends Icon { width + doubleBorderWidth, height + doubleBorderWidth); this.svgDialog!.setAttribute('width', `${width}`); this.svgDialog!.setAttribute('height', `${height}`); - this.workspace.setCachedParentSvgSize(width, height); + this.workspace_.setCachedParentSvgSize(width, height); } if (isRtl) { // Scroll the workspace to always left-align. canvas.setAttribute('transform', `translate(${this.workspaceWidth}, 0)`); } - this.workspace.resize(); + this.workspace_.resize(); } /** A method handler for when the bubble is moved. */ private onBubbleMove() { - if (this.workspace) { - this.workspace.recordDragTargets(); + if (this.workspace_) { + this.workspace_.recordDragTargets(); } } @@ -321,7 +325,7 @@ export class Mutator extends Icon { block.workspace, this.createEditor(), block.pathObject.svgPath, (this.iconXY_ as Coordinate), null, null); // The workspace was created in createEditor. - const ws = this.workspace!; + const ws = this.workspace_!; // Expose this mutator's block's ID on its top-level SVG group. this.bubble_.setSvgId(block.id); this.bubble_.registerMoveEvent(this.onBubbleMove.bind(this)); @@ -374,8 +378,8 @@ export class Mutator extends Icon { } else { // Dispose of the bubble. this.svgDialog = null; - this.workspace!.dispose(); - this.workspace = null; + this.workspace_!.dispose(); + this.workspace_ = null; this.rootBlock = null; this.bubble_?.dispose(); this.bubble_ = null; @@ -420,8 +424,8 @@ export class Mutator extends Icon { * Bump down any block that's too high. */ private updateWorkspace() { - if (!this.workspace!.isDragging()) { - const blocks = this.workspace!.getTopBlocks(false); + if (!this.workspace_!.isDragging()) { + const blocks = this.workspace_!.getTopBlocks(false); const MARGIN = 20; for (let b = 0, block; block = blocks[b]; b++) { @@ -434,7 +438,7 @@ export class Mutator extends Icon { // Bump any block overlapping the flyout back inside. if (block.RTL) { let right = -MARGIN; - const flyout = this.workspace!.getFlyout(); + const flyout = this.workspace_!.getFlyout(); if (flyout) { right -= flyout.getWidth(); } @@ -448,7 +452,7 @@ export class Mutator extends Icon { } // When the mutator's workspace changes, update the source block. - if (this.rootBlock && this.rootBlock.workspace === this.workspace) { + if (this.rootBlock && this.rootBlock.workspace === this.workspace_) { const existingGroup = eventUtils.getGroup(); if (!existingGroup) { eventUtils.setGroup(true); @@ -488,7 +492,7 @@ export class Mutator extends Icon { // Don't update the bubble until the drag has ended, to avoid moving // blocks under the cursor. - if (!this.workspace!.isDragging()) { + if (!this.workspace_!.isDragging()) { setTimeout(() => this.resizeBubble(), 0); } eventUtils.setGroup(existingGroup); @@ -503,7 +507,7 @@ export class Mutator extends Icon { /** Update the styles on all blocks in the mutator. */ updateBlockStyle() { - const ws = this.workspace; + const ws = this.workspace_; if (ws && ws.getAllBlocks(false)) { const workspaceBlocks = ws.getAllBlocks(false); From c6d8dcb09aba2299b0efef03869f38ad2639c34c Mon Sep 17 00:00:00 2001 From: Maribeth Bottorff Date: Mon, 21 Nov 2022 10:43:09 -0800 Subject: [PATCH 6/7] release: Update version number to 9.1.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 a76740e90..9e9520800 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "blockly", - "version": "9.1.0", + "version": "9.1.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "blockly", - "version": "9.1.0", + "version": "9.1.1", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index bd6b5fe4e..fa40dd440 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "blockly", - "version": "9.1.0", + "version": "9.1.1", "description": "Blockly is a library for building visual programming editors.", "keywords": [ "blockly" From 351a696e710370456465a4fd05f9c7449b012571 Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Fri, 25 Nov 2022 20:34:32 +0100 Subject: [PATCH 7/7] fix: Add redirects to old demos. (#6657) --- appengine/app.yaml | 53 ++++++++++++++++++++++++++++++++++++++++- appengine/redirect.html | 44 +++++++++++++++++++--------------- 2 files changed, 77 insertions(+), 20 deletions(-) diff --git a/appengine/app.yaml b/appengine/app.yaml index 2fd93c494..1778f2b93 100644 --- a/appengine/app.yaml +++ b/appengine/app.yaml @@ -14,6 +14,58 @@ handlers: - url: /static/apps/.* static_files: redirect.html upload: redirect.html +# Certain demos were moved on 25 Nov 2022. +- url: /static/demos/fixed/.* + static_files: redirect.html + upload: redirect.html +- url: /static/demos/resizable/.* + static_files: redirect.html + upload: redirect.html +- url: /static/demos/toolbox/.* + static_files: redirect.html + upload: redirect.html +- url: /static/demos/maxBlocks/.* + static_files: redirect.html + upload: redirect.html +- url: /static/demos/generator/.* + static_files: redirect.html + upload: redirect.html +- url: /static/demos/headless/.* + static_files: redirect.html + upload: redirect.html +- url: /static/demos/interpreter/step-execution.* + static_files: redirect.html + upload: redirect.html +- url: /static/demos/interpreter/async-execution.* + static_files: redirect.html + upload: redirect.html +- url: /static/demos/graph/.* + static_files: redirect.html + upload: redirect.html +- url: /static/demos/rtl/.* + static_files: redirect.html + upload: redirect.html +- url: /static/demos/custom-dialogs/.* + static_files: redirect.html + upload: redirect.html +- url: /static/demos/custom-fields/turtle/.* + static_files: redirect.html + upload: redirect.html +- url: /static/demos/custom-fields/pitch/.* + static_files: redirect.html + upload: redirect.html +- url: /static/demos/mirror/.* + static_files: redirect.html + upload: redirect.html +- url: /static/demos/plane/.* + static_files: redirect.html + upload: redirect.html +- url: /static/demos/keyboard_nav/.* + static_files: redirect.html + upload: redirect.html +- url: /static/demos/custom-fields/.* + static_files: redirect.html + upload: redirect.html # Blockly files. - url: /static @@ -50,4 +102,3 @@ handlers: - url: /.* script: auto secure: always - \ No newline at end of file diff --git a/appengine/redirect.html b/appengine/redirect.html index 63d892d71..cc7cf3018 100644 --- a/appengine/redirect.html +++ b/appengine/redirect.html @@ -47,51 +47,57 @@ if (loc.match('/apps/plane/plane.html')) { } } -if (loc.match('/apps/puzzle/')) { +if (loc.includes('/apps/puzzle/')) { // Puzzle moved to Blockly Games on 15 Oct 2014. loc = 'https://blockly.games/puzzle'; -} else if (loc.match('/apps/maze/')) { +} else if (loc.includes('/apps/maze/')) { // Maze moved to Blockly Games on 10 Nov 2014. loc = 'https://blockly.games/maze'; -} else if (loc.match('/apps/turtle/')) { +} else if (loc.includes('/apps/turtle/')) { // Turtle moved to Blockly Games on 10 Nov 2014. loc = 'https://blockly.games/turtle'; -} else if (loc.match('/apps/')) { +} else if (loc.includes('/apps/')) { // Remaining apps moved to demos on 20 Nov 2014. loc = loc.replace('/apps/', '/demos/'); } // Demos without saved data were moved to Blockly Samples in 2021. -if (loc.match('/demos/fixed/')) { +if (loc.includes('/demos/fixed/')) { loc = 'https://google.github.io/blockly-samples/examples/fixed-demo/'; -} else if (loc.match('/demos/resizable/')) { +} else if (loc.includes('/demos/resizable/overlay')) { + loc = 'https://google.github.io/blockly-samples/examples/resizable-demo/overlay.html'; +} else if (loc.includes('/demos/resizable/')) { loc = 'https://google.github.io/blockly-samples/examples/resizable-demo/'; -} else if (loc.match('/demos/toolbox/')) { +} else if (loc.includes('/demos/toolbox/')) { loc = 'https://google.github.io/blockly-samples/examples/toolbox-demo/'; -} else if (loc.match('/demos/maxBlocks/')) { +} else if (loc.includes('/demos/maxBlocks/')) { loc = 'https://google.github.io/blockly-samples/examples/max-blocks-demo/'; -} else if (loc.match('/demos/generator/')) { +} else if (loc.includes('/demos/generator/')) { loc = 'https://google.github.io/blockly-samples/examples/generator-demo/'; -} else if (loc.match('/demos/headless/')) { +} else if (loc.includes('/demos/headless/')) { loc = 'https://google.github.io/blockly-samples/examples/headless-demo/'; -} else if (loc.match('/demos/interpreter/step-execution')) { +} else if (loc.includes('/demos/interpreter/step-execution')) { loc = 'https://google.github.io/blockly-samples/examples/interpreter-demo/step-execution.html'; -} else if (loc.match('/demos/interpreter/async-execution')) { +} else if (loc.includes('/demos/interpreter/async-execution')) { loc = 'https://google.github.io/blockly-samples/examples/interpreter-demo/async-execution.html'; -} else if (loc.match('/demos/graph/')) { +} else if (loc.includes('/demos/graph/')) { loc = 'https://google.github.io/blockly-samples/examples/graph-demo/'; -} else if (loc.match('/demos/rtl/')) { +} else if (loc.includes('/demos/rtl/')) { loc = 'https://google.github.io/blockly-samples/examples/rtl-demo/'; -} else if (loc.match('/demos/custom-dialogs/')) { +} else if (loc.includes('/demos/custom-dialogs/')) { loc = 'https://google.github.io/blockly-samples/examples/custom-dialogs-demo'; -} else if (loc.match('/demos/custom-fields/turtle/')) { +} else if (loc.includes('/demos/custom-fields/turtle/')) { loc = 'https://google.github.io/blockly-samples/examples/turtle-field-demo/'; -} else if (loc.match('/demos/custom-fields/pitch/')) { +} else if (loc.includes('/demos/custom-fields/pitch/')) { loc = 'https://google.github.io/blockly-samples/examples/pitch-field-demo/'; -} else if (loc.match('/demos/mirror/')) { +} else if (loc.includes('/demos/mirror/')) { loc = 'https://google.github.io/blockly-samples/examples/mirror-demo/'; -} else if (loc.match('/demos/plane/')) { +} else if (loc.includes('/demos/plane/')) { loc = 'https://google.github.io/blockly-samples/examples/plane-demo/'; +} else if (loc.includes('/demos/keyboard_nav/')) { + loc = 'https://google.github.io/blockly-samples/plugins/keyboard-navigation/test/'; +} else if (loc.includes('/demos/custom-fields/')) { + loc = 'https://google.github.io/blockly-samples/examples/pitch-field-demo/'; } location = loc;