From f682fa818bee77b779bf6f694acaf8e1d2262082 Mon Sep 17 00:00:00 2001 From: Maribeth Moffatt Date: Tue, 19 Aug 2025 11:22:17 -0400 Subject: [PATCH 01/29] chore: lint error on only in mocha tests (#9300) --- eslint.config.mjs | 5 +++++ package-lock.json | 26 ++++++++++++++++++++++++++ package.json | 1 + 3 files changed, 32 insertions(+) diff --git a/eslint.config.mjs b/eslint.config.mjs index f018e525d87..0560586cbcc 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,6 +1,7 @@ import eslint from '@eslint/js'; import googleStyle from 'eslint-config-google'; import jsdoc from 'eslint-plugin-jsdoc'; +import mochaPlugin from 'eslint-plugin-mocha'; import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'; import globals from 'globals'; import tseslint from 'typescript-eslint'; @@ -200,6 +201,9 @@ export default [ }, { files: ['tests/**'], + plugins: { + mocha: mochaPlugin, + }, languageOptions: { globals: { 'Blockly': true, @@ -219,6 +223,7 @@ export default [ 'jsdoc/check-tag-names': ['warn', {'definedTags': ['record']}], 'jsdoc/tag-lines': ['off'], 'jsdoc/no-defaults': ['off'], + 'mocha/no-exclusive-tests': 'error', }, }, { diff --git a/package-lock.json b/package-lock.json index e03f6d24d46..c491963ecee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,6 +28,7 @@ "eslint-config-google": "^0.14.0", "eslint-config-prettier": "^10.1.1", "eslint-plugin-jsdoc": "^52.0.2", + "eslint-plugin-mocha": "^11.1.0", "eslint-plugin-prettier": "^5.2.1", "glob": "^11.0.1", "globals": "^16.0.0", @@ -4137,6 +4138,31 @@ "spdx-license-ids": "^3.0.0" } }, + "node_modules/eslint-plugin-mocha": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-11.1.0.tgz", + "integrity": "sha512-rKntVWRsQFPbf8OkSgVNRVRrcVAPaGTyEgWCEyXaPDJkTl0v5/lwu1vTk5sWiUJU8l2sxwvGUZzSNrEKdVMeQw==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.1", + "globals": "^15.14.0" + }, + "peerDependencies": { + "eslint": ">=9.0.0" + } + }, + "node_modules/eslint-plugin-mocha/node_modules/globals": { + "version": "15.15.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.15.0.tgz", + "integrity": "sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/eslint-plugin-prettier": { "version": "5.5.1", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.1.tgz", diff --git a/package.json b/package.json index e7a496b31f8..da9f3db1aa5 100644 --- a/package.json +++ b/package.json @@ -115,6 +115,7 @@ "eslint-config-google": "^0.14.0", "eslint-config-prettier": "^10.1.1", "eslint-plugin-jsdoc": "^52.0.2", + "eslint-plugin-mocha": "^11.1.0", "eslint-plugin-prettier": "^5.2.1", "glob": "^11.0.1", "globals": "^16.0.0", From b5343f3c886a2e0c5420644c2a995b67939e6164 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 08:28:11 -0700 Subject: [PATCH 02/29] chore(deps): bump actions/checkout from 4 to 5 (#9320) Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' 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> --- .github/workflows/appengine_deploy.yml | 2 +- .github/workflows/browser_test.yml | 2 +- .github/workflows/build.yml | 6 +++--- .github/workflows/keyboard_plugin_test.yml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/appengine_deploy.yml b/.github/workflows/appengine_deploy.yml index 50afec2407c..efc6fe9417d 100644 --- a/.github/workflows/appengine_deploy.yml +++ b/.github/workflows/appengine_deploy.yml @@ -15,7 +15,7 @@ jobs: steps: # Checks-out the repository under $GITHUB_WORKSPACE. # When running manually this checks out the master branch. - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Prepare demo files # Install all dependencies, then copy all the files needed for demos. diff --git a/.github/workflows/browser_test.yml b/.github/workflows/browser_test.yml index 51ac0dffada..c2ce9913635 100644 --- a/.github/workflows/browser_test.yml +++ b/.github/workflows/browser_test.yml @@ -26,7 +26,7 @@ jobs: # https://nodejs.org/en/about/releases/ steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: persist-credentials: false diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c4ab688f8fd..d7a4e786ce6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,7 +23,7 @@ jobs: # https://nodejs.org/en/about/releases/ steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: persist-credentials: false @@ -54,7 +54,7 @@ jobs: timeout-minutes: 5 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Use Node.js 20.x uses: actions/setup-node@v4 @@ -71,7 +71,7 @@ jobs: timeout-minutes: 5 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Use Node.js 20.x uses: actions/setup-node@v4 diff --git a/.github/workflows/keyboard_plugin_test.yml b/.github/workflows/keyboard_plugin_test.yml index 753d31dda1e..3d7d3d5d444 100644 --- a/.github/workflows/keyboard_plugin_test.yml +++ b/.github/workflows/keyboard_plugin_test.yml @@ -25,12 +25,12 @@ jobs: steps: - name: Checkout core Blockly - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: path: core-blockly - name: Checkout keyboard navigation plugin - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: repository: 'google/blockly-keyboard-experimentation' ref: 'main' From 405f7da2806101c165d2a65008f94998d0d8aeef Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Tue, 19 Aug 2025 08:32:31 -0700 Subject: [PATCH 03/29] fix: Fix positioning of pasted blocks and comments in RTL. (#9302) * fix: Fix positioning of pasted blocks in RTL. * fix: Clean up after temporarily making the workspace RTL. * fix: Remove .only. * fix: Fix positioning of pasted comments in RTL. * fix: Fix positioning of text preview on collapsed comments in RTL. --- core/clipboard/block_paster.ts | 3 ++ core/comments/comment_view.ts | 5 +++- core/xml.ts | 2 +- tests/mocha/clipboard_test.js | 51 ++++++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+), 2 deletions(-) diff --git a/core/clipboard/block_paster.ts b/core/clipboard/block_paster.ts index 750cedca124..e782cc0b004 100644 --- a/core/clipboard/block_paster.ts +++ b/core/clipboard/block_paster.ts @@ -83,6 +83,9 @@ export function moveBlockToNotConflict( block: BlockSvg, originalPosition: Coordinate, ) { + if (block.workspace.RTL) { + originalPosition.x = block.workspace.getWidth() - originalPosition.x; + } const workspace = block.workspace; const snapRadius = config.snapRadius; const bumpOffset = Coordinate.difference( diff --git a/core/comments/comment_view.ts b/core/comments/comment_view.ts index ca0c261c390..b1cd628f8dd 100644 --- a/core/comments/comment_view.ts +++ b/core/comments/comment_view.ts @@ -368,7 +368,10 @@ export class CommentView implements IRenderedElement { const textPreviewWidth = size.width - foldoutSize.getWidth() - deleteSize.getWidth(); - this.textPreview.setAttribute('x', `${foldoutSize.getWidth()}`); + this.textPreview.setAttribute( + 'x', + `${(this.workspace.RTL ? -1 : 1) * foldoutSize.getWidth()}`, + ); this.textPreview.setAttribute( 'y', `${textPreviewMargin + textPreviewSize.height / 2}`, diff --git a/core/xml.ts b/core/xml.ts index cc26d8c8a2c..362a59ab287 100644 --- a/core/xml.ts +++ b/core/xml.ts @@ -68,7 +68,7 @@ export function saveWorkspaceComment( if (!skipId) elem.setAttribute('id', comment.id); const workspace = comment.workspace; - const loc = comment.getRelativeToSurfaceXY(); + const loc = comment.getRelativeToSurfaceXY().clone(); loc.x = workspace.RTL ? workspace.getWidth() - loc.x : loc.x; elem.setAttribute('x', `${loc.x}`); elem.setAttribute('y', `${loc.y}`); diff --git a/tests/mocha/clipboard_test.js b/tests/mocha/clipboard_test.js index d58f78b9b50..5a513b44a9e 100644 --- a/tests/mocha/clipboard_test.js +++ b/tests/mocha/clipboard_test.js @@ -157,6 +157,34 @@ suite('Clipboard', function () { ); }); + test('pasted blocks are bumped to not overlap in RTL', function () { + this.workspace.dispose(); + this.workspace = Blockly.inject('blocklyDiv', {rtl: true}); + const block = Blockly.serialization.blocks.append( + { + 'type': 'controls_if', + 'x': 38, + 'y': 13, + }, + this.workspace, + ); + const data = block.toCopyData(); + + const newBlock = Blockly.clipboard.paste(data, this.workspace); + const oldBlockXY = block.getRelativeToSurfaceXY(); + assert.deepEqual( + newBlock.getRelativeToSurfaceXY(), + new Blockly.utils.Coordinate( + oldBlockXY.x - Blockly.config.snapRadius, + oldBlockXY.y + Blockly.config.snapRadius * 2, + ), + ); + + // Restore an LTR workspace. + this.workspace.dispose(); + this.workspace = Blockly.inject('blocklyDiv'); + }); + test('pasted blocks are bumped to be outside the connection snap radius', function () { Blockly.serialization.workspaces.load( { @@ -208,5 +236,28 @@ suite('Clipboard', function () { new Blockly.utils.Coordinate(40, 40), ); }); + + test('pasted comments are bumped to not overlap in RTL', function () { + this.workspace.dispose(); + this.workspace = Blockly.inject('blocklyDiv', {rtl: true}); + Blockly.Xml.domToWorkspace( + Blockly.utils.xml.textToDom( + '', + ), + this.workspace, + ); + const comment = this.workspace.getTopComments(false)[0]; + const data = comment.toCopyData(); + + const newComment = Blockly.clipboard.paste(data, this.workspace); + const oldCommentXY = comment.getRelativeToSurfaceXY(); + assert.deepEqual( + newComment.getRelativeToSurfaceXY(), + new Blockly.utils.Coordinate(oldCommentXY.x - 30, oldCommentXY.y + 30), + ); + // Restore an LTR workspace. + this.workspace.dispose(); + this.workspace = Blockly.inject('blocklyDiv'); + }); }); }); From ac7619a6222a2c9bc3b34c6908093490ac02733b Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Tue, 19 Aug 2025 14:56:59 -0700 Subject: [PATCH 04/29] chore: Fix documentation generation warnings. (#9325) * chore: Replace @yields with @returns. * fix: Update the ESLint config to not require @yields. * chore: Move docs onto getters. --- core/block.ts | 2 +- core/field.ts | 3 --- core/field_input.ts | 6 ++---- eslint.config.mjs | 3 ++- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/core/block.ts b/core/block.ts index d15700a7e19..af44facda5d 100644 --- a/core/block.ts +++ b/core/block.ts @@ -1126,7 +1126,7 @@ export class Block { /** * Returns a generator that provides every field on the block. * - * @yields A generator that can be used to iterate the fields on the block. + * @returns A generator that can be used to iterate the fields on the block. */ *getFields(): Generator { for (const input of this.inputList) { diff --git a/core/field.ts b/core/field.ts index fdcb2d693b9..3d12880a93a 100644 --- a/core/field.ts +++ b/core/field.ts @@ -119,9 +119,6 @@ export abstract class Field return this.size; } - /** - * Sets the size of this field. - */ protected set size_(newValue: Size) { this.size = newValue; } diff --git a/core/field_input.ts b/core/field_input.ts index b685309183a..97ad0e9594d 100644 --- a/core/field_input.ts +++ b/core/field_input.ts @@ -102,11 +102,9 @@ export abstract class FieldInput extends Field< */ override SERIALIZABLE = true; - /** - * Sets the size of this field. Although this appears to be a no-op, it must - * exist since the getter is overridden below. - */ protected override set size_(newValue: Size) { + // Although this appears to be a no-op, it must exist since the getter is + // overridden below. super.size_ = newValue; } diff --git a/eslint.config.mjs b/eslint.config.mjs index 0560586cbcc..744e02b45bf 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -89,7 +89,8 @@ function buildTSOverride({files, tsconfig}) { '@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'], - + // TSDoc doesn't support @yields, so don't require that we use it. + 'jsdoc/require-yields': ['off'], // params and returns docs are optional. 'jsdoc/require-param-description': ['off'], 'jsdoc/require-returns': ['off'], From 5cc95e44e78a0b5c0a96865adb962cf012916254 Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Wed, 20 Aug 2025 11:26:45 -0700 Subject: [PATCH 05/29] fix: Show the delete cursor when dragging a block by an editable field. (#9326) --- core/css.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/css.ts b/core/css.ts index 30ee47fc58a..503b6362ba2 100644 --- a/core/css.ts +++ b/core/css.ts @@ -181,7 +181,8 @@ let content = ` cursor: -webkit-grabbing; } -.blocklyDragging.blocklyDraggingDelete { +.blocklyDragging.blocklyDraggingDelete, +.blocklyDragging.blocklyDraggingDelete .blocklyField { cursor: url("<<>>/handdelete.cur"), auto; } From 3e26b00038af4c87a516c04682699ebbb124aa1c Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Thu, 21 Aug 2025 11:05:43 -0700 Subject: [PATCH 06/29] fix: Correct the alignment of narrow text in input fields. (#9327) * fix: Correct the alignment of narrow text in input fields. * chore: Clarify purpose of first argument to positionTextElement_(). --- core/field.ts | 3 +-- core/field_dropdown.ts | 7 +++---- core/field_input.ts | 26 ++++++++++++++++++++++++-- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/core/field.ts b/core/field.ts index 3d12880a93a..d993e197d23 100644 --- a/core/field.ts +++ b/core/field.ts @@ -849,8 +849,7 @@ export abstract class Field totalHeight = Math.max(totalHeight, constants!.FIELD_BORDER_RECT_HEIGHT); } - this.size_.height = totalHeight; - this.size_.width = totalWidth; + this.size_ = new Size(totalWidth, totalHeight); this.positionTextElement_(xOffset, contentWidth); this.positionBorderRect_(); diff --git a/core/field_dropdown.ts b/core/field_dropdown.ts index 8b01ccddab1..3be5c94c3e3 100644 --- a/core/field_dropdown.ts +++ b/core/field_dropdown.ts @@ -29,6 +29,7 @@ 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 {Size} from './utils/size.js'; import * as utilsString from './utils/string.js'; import {Svg} from './utils/svg.js'; @@ -553,8 +554,7 @@ export class FieldDropdown extends Field { } else { arrowWidth = dom.getTextWidth(this.arrow as SVGTSpanElement); } - this.size_.width = imageWidth + arrowWidth + xPadding * 2; - this.size_.height = height; + this.size_ = new Size(imageWidth + arrowWidth + xPadding * 2, height); let arrowX = 0; if (block.RTL) { @@ -595,8 +595,7 @@ export class FieldDropdown extends Field { height / 2 - this.getConstants()!.FIELD_DROPDOWN_SVG_ARROW_SIZE / 2, ); } - this.size_.width = textWidth + arrowWidth + xPadding * 2; - this.size_.height = height; + this.size_ = new Size(textWidth + arrowWidth + xPadding * 2, height); this.positionTextElement_(xPadding, textWidth); } diff --git a/core/field_input.ts b/core/field_input.ts index 97ad0e9594d..55383a4c1d2 100644 --- a/core/field_input.ts +++ b/core/field_input.ts @@ -45,6 +45,11 @@ import type {WorkspaceSvg} from './workspace_svg.js'; */ type InputTypes = string | number; +/** + * The minimum width of an input field. + */ +const MINIMUM_WIDTH = 14; + /** * Abstract class for an editable input field. * @@ -113,8 +118,8 @@ export abstract class FieldInput extends Field< */ protected override get size_() { const s = super.size_; - if (s.width < 14) { - s.width = 14; + if (s.width < MINIMUM_WIDTH) { + s.width = MINIMUM_WIDTH; } return s; @@ -730,6 +735,23 @@ export abstract class FieldInput extends Field< return true; } + /** + * Position a field's text element after a size change. This handles both LTR + * and RTL positioning. + * + * @param xMargin x offset to use when positioning the text element. + * @param contentWidth The content width. + */ + protected override positionTextElement_( + xMargin: number, + contentWidth: number, + ) { + const effectiveWidth = xMargin * 2 + contentWidth; + const delta = + effectiveWidth < MINIMUM_WIDTH ? (MINIMUM_WIDTH - effectiveWidth) / 2 : 0; + super.positionTextElement_(xMargin + delta, contentWidth); + } + /** * Use the `getText_` developer hook to override the field's text * representation. When we're currently editing, return the current HTML value From c6730ab74fb5ba5025055fb5e55b1f0152450dba Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Thu, 21 Aug 2025 11:15:07 -0700 Subject: [PATCH 07/29] fix: Fix bug that caused inadvertent scrolling when the `WidgetDiv` was shown. (#9291) * fix: Fix bug that caused inadvertent scrolling when the `WidgetDiv` was shown. * chore: Add test to verify that displaying the context menu does not scroll the page. * chore: Clarify comments. * fix: Remove errant `.only`. * chore: Add test to verify that actively focusing a node does not scroll the page. * fix: Remove inadvertent `.only`. --- core/focus_manager.ts | 8 +++- core/interfaces/i_focusable_node.ts | 3 ++ tests/browser/test/basic_playground_test.mjs | 39 ++++++++++++++++++++ 3 files changed, 48 insertions(+), 2 deletions(-) diff --git a/core/focus_manager.ts b/core/focus_manager.ts index 02e0591070f..47e4324540d 100644 --- a/core/focus_manager.ts +++ b/core/focus_manager.ts @@ -309,6 +309,8 @@ export class FocusManager { * Note that this may update the specified node's element's tabindex to ensure * that it can be properly read out by screenreaders while focused. * + * The focused node will not be automatically scrolled into view. + * * @param focusableNode The node that should receive active focus. */ focusNode(focusableNode: IFocusableNode): void { @@ -423,6 +425,8 @@ export class FocusManager { * the returned lambda is called. Additionally, only 1 ephemeral focus context * can be active at any given time (attempting to activate more than one * simultaneously will result in an error being thrown). + * + * This method does not scroll the ephemerally focused element into view. */ takeEphemeralFocus( focusableElement: HTMLElement | SVGElement, @@ -439,7 +443,7 @@ export class FocusManager { if (this.focusedNode) { this.passivelyFocusNode(this.focusedNode, null); } - focusableElement.focus(); + focusableElement.focus({preventScroll: true}); let hasFinishedEphemeralFocus = false; return () => { @@ -574,7 +578,7 @@ export class FocusManager { } this.setNodeToVisualActiveFocus(node); - elem.focus(); + elem.focus({preventScroll: true}); } /** diff --git a/core/interfaces/i_focusable_node.ts b/core/interfaces/i_focusable_node.ts index 24833328d7f..57ec1a126e1 100644 --- a/core/interfaces/i_focusable_node.ts +++ b/core/interfaces/i_focusable_node.ts @@ -59,6 +59,9 @@ export interface IFocusableNode { * they should avoid the following: * - Creating or removing DOM elements (including via the renderer or drawer). * - Affecting focus via DOM focus() calls or the FocusManager. + * + * Implementations may consider scrolling themselves into view here; that is + * not handled by the focus manager. */ onNodeFocus(): void; diff --git a/tests/browser/test/basic_playground_test.mjs b/tests/browser/test/basic_playground_test.mjs index 4c54523bd7f..c7c8a5a370c 100644 --- a/tests/browser/test/basic_playground_test.mjs +++ b/tests/browser/test/basic_playground_test.mjs @@ -101,6 +101,45 @@ suite('Right Clicking on Blocks', function () { await contextMenuSelect(this.browser, this.block, 'Remove Comment'); chai.assert.isNull(await getCommentText(this.browser, this.block.id)); }); + + test('does not scroll the page when node is ephemerally focused', async function () { + const initialScroll = await this.browser.execute(() => { + return window.scrollY; + }); + // This left-right-left sequence was necessary to reproduce unintended + // scrolling; regardless of the number of clicks/context menu activations, + // the page should not scroll. + this.block.click({button: 2}); + this.block.click({button: 0}); + this.block.click({button: 2}); + await this.browser.pause(250); + const finalScroll = await this.browser.execute(() => { + return window.scrollY; + }); + + chai.assert.equal(initialScroll, finalScroll); + }); + + test('does not scroll the page when node is actively focused', async function () { + await this.browser.setWindowSize(500, 300); + await this.browser.setViewport({width: 500, height: 300}); + const initialScroll = await this.browser.execute((blockId) => { + window.scrollTo(0, document.body.scrollHeight); + return window.scrollY; + }, this.block.id); + await this.browser.execute(() => { + Blockly.getFocusManager().focusNode( + Blockly.getMainWorkspace().getToolbox(), + ); + }); + const finalScroll = await this.browser.execute(() => { + return window.scrollY; + }); + + chai.assert.equal(initialScroll, finalScroll); + await this.browser.setWindowSize(800, 600); + await this.browser.setViewport({width: 800, height: 600}); + }); }); suite('Disabling', function () { From cacd3583f5a7e061165d1fabe251e1e366f154f6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Aug 2025 12:06:10 -0700 Subject: [PATCH 08/29] chore(deps): bump eslint-plugin-prettier from 5.5.1 to 5.5.4 (#9319) Bumps [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) from 5.5.1 to 5.5.4. - [Release notes](https://github.com/prettier/eslint-plugin-prettier/releases) - [Changelog](https://github.com/prettier/eslint-plugin-prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/eslint-plugin-prettier/compare/v5.5.1...v5.5.4) --- updated-dependencies: - dependency-name: eslint-plugin-prettier dependency-version: 5.5.4 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, 4 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index c491963ecee..c20932519c1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4164,10 +4164,11 @@ } }, "node_modules/eslint-plugin-prettier": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.1.tgz", - "integrity": "sha512-dobTkHT6XaEVOo8IO90Q4DOSxnm3Y151QxPJlM/vKC0bVy+d6cVWQZLlFiuZPP0wS6vZwSKeJgKkcS+KfMBlRw==", + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.4.tgz", + "integrity": "sha512-swNtI95SToIz05YINMA6Ox5R057IMAmWZ26GqPxusAp1TZzj+IdY9tXNWWD3vkF/wEqydCONcwjTFpxybBqZsg==", "dev": true, + "license": "MIT", "dependencies": { "prettier-linter-helpers": "^1.0.0", "synckit": "^0.11.7" From 802472486e755554188f2f7ba88ad71381f211c7 Mon Sep 17 00:00:00 2001 From: Ennis Nian Date: Fri, 22 Aug 2025 04:59:09 +0800 Subject: [PATCH 09/29] fix: pointercancel event is not handled (#9250) --- core/touch.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/core/touch.ts b/core/touch.ts index 8fb2cd2298c..9af3b1f9494 100644 --- a/core/touch.ts +++ b/core/touch.ts @@ -46,6 +46,7 @@ export const TOUCH_MAP: {[key: string]: string[]} = { 'mouseup': ['pointerup', 'pointercancel'], 'touchend': ['pointerup'], 'touchcancel': ['pointercancel'], + 'pointerup': ['pointerup', 'pointercancel'], }; /** PID of queued long-press task. */ From dd05c8de2ff5506bfa99b8bc7b48e5ac87bfb770 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Aug 2025 20:01:03 +0100 Subject: [PATCH 10/29] chore(deps): bump eslint-config-prettier from 10.1.5 to 10.1.8 (#9321) Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 10.1.5 to 10.1.8. - [Release notes](https://github.com/prettier/eslint-config-prettier/releases) - [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/eslint-config-prettier/compare/v10.1.5...v10.1.8) --- updated-dependencies: - dependency-name: eslint-config-prettier dependency-version: 10.1.8 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, 4 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index c20932519c1..24f3ad602d8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4076,10 +4076,11 @@ } }, "node_modules/eslint-config-prettier": { - "version": "10.1.5", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.5.tgz", - "integrity": "sha512-zc1UmCpNltmVY34vuLRV61r1K27sWuX39E+uyUnY8xS2Bex88VV9cugG+UZbRSRGtGyFboj+D8JODyme1plMpw==", + "version": "10.1.8", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz", + "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", "dev": true, + "license": "MIT", "bin": { "eslint-config-prettier": "bin/cli.js" }, From 3b498d1384baba09e3787b1ce92bb1364d121304 Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Fri, 22 Aug 2025 14:55:07 -0700 Subject: [PATCH 11/29] fix: Allow reregistering fields. (#9290) --- core/field_registry.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/field_registry.ts b/core/field_registry.ts index 06bb9acd045..e02ece75c96 100644 --- a/core/field_registry.ts +++ b/core/field_registry.ts @@ -56,11 +56,11 @@ export interface RegistrableField { * @param type The field type name as used in the JSON definition. * @param fieldClass The field class containing a fromJson function that can * construct an instance of the field. - * @throws {Error} if the type name is empty, the field is already registered, - * or the fieldClass is not an object containing a fromJson function. + * @throws {Error} if the type name is empty or the fieldClass is not an object + * containing a fromJson function. */ export function register(type: string, fieldClass: RegistrableField) { - registry.register(registry.Type.FIELD, type, fieldClass); + registry.register(registry.Type.FIELD, type, fieldClass, true); } /** From 8873e5fe7ac03f150a066dca1b24e7d90e183ec4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Aug 2025 09:08:01 -0700 Subject: [PATCH 12/29] chore(deps): bump chai from 5.2.1 to 6.0.1 (#9330) * chore(deps): bump chai from 5.2.1 to 6.0.1 Bumps [chai](https://github.com/chaijs/chai) from 5.2.1 to 6.0.1. - [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.2.1...v6.0.1) --- updated-dependencies: - dependency-name: chai dependency-version: 6.0.1 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * fix: Fix Chai import path. --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Aaron Dodson --- package-lock.json | 60 ++----------------- package.json | 2 +- tests/mocha/block_json_test.js | 2 +- tests/mocha/block_test.js | 2 +- tests/mocha/blocks/lists_test.js | 2 +- tests/mocha/blocks/logic_ternary_test.js | 2 +- tests/mocha/blocks/loops_test.js | 2 +- tests/mocha/blocks/procedures_test.js | 2 +- tests/mocha/blocks/variables_test.js | 2 +- tests/mocha/clipboard_test.js | 2 +- tests/mocha/comment_deserialization_test.js | 2 +- tests/mocha/comment_test.js | 2 +- tests/mocha/comment_view_test.js | 2 +- tests/mocha/connection_checker_test.js | 2 +- tests/mocha/connection_db_test.js | 2 +- tests/mocha/connection_test.js | 2 +- tests/mocha/contextmenu_items_test.js | 2 +- tests/mocha/contextmenu_test.js | 2 +- tests/mocha/cursor_test.js | 2 +- tests/mocha/dialog_test.js | 2 +- tests/mocha/dropdowndiv_test.js | 2 +- tests/mocha/event_block_change_test.js | 2 +- tests/mocha/event_block_create_test.js | 2 +- tests/mocha/event_block_delete_test.js | 2 +- tests/mocha/event_block_drag_test.js | 2 +- ...nt_block_field_intermediate_change_test.js | 2 +- tests/mocha/event_block_move_test.js | 2 +- tests/mocha/event_bubble_open_test.js | 2 +- tests/mocha/event_click_test.js | 2 +- tests/mocha/event_comment_change_test.js | 2 +- tests/mocha/event_comment_collapse_test.js | 2 +- tests/mocha/event_comment_create_test.js | 2 +- tests/mocha/event_comment_delete_test.js | 2 +- tests/mocha/event_comment_drag_test.js | 2 +- tests/mocha/event_comment_move_test.js | 2 +- tests/mocha/event_comment_resize_test.js | 2 +- tests/mocha/event_selected_test.js | 2 +- tests/mocha/event_test.js | 2 +- tests/mocha/event_theme_change_test.js | 2 +- tests/mocha/event_toolbox_item_select_test.js | 2 +- tests/mocha/event_trashcan_open_test.js | 2 +- tests/mocha/event_var_create_test.js | 2 +- tests/mocha/event_var_delete_test.js | 2 +- tests/mocha/event_var_rename_test.js | 2 +- tests/mocha/event_var_type_change_test.js | 2 +- tests/mocha/event_viewport_test.js | 2 +- tests/mocha/extensions_test.js | 2 +- tests/mocha/field_checkbox_test.js | 2 +- tests/mocha/field_colour_test.js | 2 +- tests/mocha/field_dropdown_test.js | 2 +- tests/mocha/field_image_test.js | 2 +- tests/mocha/field_label_serializable_test.js | 2 +- tests/mocha/field_label_test.js | 2 +- tests/mocha/field_number_test.js | 2 +- tests/mocha/field_registry_test.js | 2 +- tests/mocha/field_test.js | 2 +- tests/mocha/field_textinput_test.js | 2 +- tests/mocha/field_variable_test.js | 2 +- tests/mocha/flyout_test.js | 2 +- tests/mocha/focus_manager_test.js | 2 +- tests/mocha/focusable_tree_traverser_test.js | 2 +- tests/mocha/generator_test.js | 2 +- tests/mocha/gesture_test.js | 2 +- tests/mocha/icon_test.js | 2 +- tests/mocha/input_test.js | 2 +- tests/mocha/insertion_marker_test.js | 2 +- tests/mocha/jso_deserialization_test.js | 2 +- tests/mocha/jso_serialization_test.js | 2 +- tests/mocha/json_test.js | 2 +- .../keyboard_navigation_controller_test.js | 2 +- tests/mocha/layering_test.js | 2 +- tests/mocha/metrics_test.js | 2 +- tests/mocha/mutator_test.js | 2 +- tests/mocha/names_test.js | 2 +- tests/mocha/navigation_test.js | 2 +- tests/mocha/old_workspace_comment_test.js | 2 +- tests/mocha/procedure_map_test.js | 2 +- tests/mocha/rect_test.js | 2 +- tests/mocha/registry_test.js | 2 +- tests/mocha/render_management_test.js | 2 +- tests/mocha/serializer_test.js | 2 +- tests/mocha/shortcut_items_test.js | 2 +- tests/mocha/shortcut_registry_test.js | 2 +- tests/mocha/test_helpers/code_generation.js | 2 +- tests/mocha/test_helpers/events.js | 2 +- tests/mocha/test_helpers/fields.js | 2 +- tests/mocha/test_helpers/procedures.js | 2 +- tests/mocha/test_helpers/serialization.js | 2 +- tests/mocha/test_helpers/variables.js | 2 +- tests/mocha/test_helpers/warnings.js | 2 +- tests/mocha/test_helpers/workspace.js | 2 +- tests/mocha/theme_test.js | 2 +- tests/mocha/toast_test.js | 2 +- tests/mocha/toolbox_test.js | 2 +- tests/mocha/tooltip_test.js | 2 +- tests/mocha/touch_test.js | 2 +- tests/mocha/trashcan_test.js | 2 +- tests/mocha/utils_test.js | 2 +- tests/mocha/variable_map_test.js | 2 +- tests/mocha/variable_model_test.js | 2 +- tests/mocha/widget_div_test.js | 2 +- tests/mocha/workspace_comment_test.js | 2 +- tests/mocha/workspace_svg_test.js | 2 +- tests/mocha/xml_test.js | 2 +- tests/mocha/zoom_controls_test.js | 2 +- 105 files changed, 108 insertions(+), 160 deletions(-) diff --git a/package-lock.json b/package-lock.json index 24f3ad602d8..287be1f1f97 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "@microsoft/api-extractor": "^7.29.5", "ajv": "^8.17.1", "async-done": "^2.0.0", - "chai": "^5.1.1", + "chai": "^6.0.1", "concurrently": "^9.0.1", "eslint": "^9.15.0", "eslint-config-google": "^0.14.0", @@ -2489,15 +2489,6 @@ "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", - "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", - "dev": true, - "engines": { - "node": ">=12" - } - }, "node_modules/assign-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", @@ -2882,18 +2873,11 @@ } }, "node_modules/chai": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-5.2.1.tgz", - "integrity": "sha512-5nFxhUrX0PqtyogoYOA8IPswy5sZFTOsBFl/9bNsmDLgsxYTzSZQJDPppDnZPTQbzSEm0hqGjWPzRemQCYbD6A==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-6.0.1.tgz", + "integrity": "sha512-/JOoU2//6p5vCXh00FpNgtlw0LjvhGttaWc+y7wpW9yjBm3ys0dI8tSKZxIOgNruz5J0RleccatSIC3uxEZP0g==", "dev": true, "license": "MIT", - "dependencies": { - "assertion-error": "^2.0.1", - "check-error": "^2.1.1", - "deep-eql": "^5.0.1", - "loupe": "^3.1.0", - "pathval": "^2.0.0" - }, "engines": { "node": ">=18" } @@ -2914,15 +2898,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/check-error": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", - "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", - "dev": true, - "engines": { - "node": ">= 16" - } - }, "node_modules/cheerio": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0.tgz", @@ -3586,15 +3561,6 @@ "node": ">=0.10" } }, - "node_modules/deep-eql": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", - "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -6794,15 +6760,6 @@ "dev": true, "license": "MIT" }, - "node_modules/loupe": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.1.tgz", - "integrity": "sha512-edNu/8D5MKVfGVFRhFf8aAxiTM6Wumfz5XsaatSxlD3w4R1d/WEKUTydCdPGbl9K7QG/Ca3GnDV2sIKIpXRQcw==", - "dev": true, - "dependencies": { - "get-func-name": "^2.0.1" - } - }, "node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -7731,15 +7688,6 @@ "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", "dev": true }, - "node_modules/pathval": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", - "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==", - "dev": true, - "engines": { - "node": ">= 14.16" - } - }, "node_modules/pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", diff --git a/package.json b/package.json index da9f3db1aa5..29865b98659 100644 --- a/package.json +++ b/package.json @@ -109,7 +109,7 @@ "@microsoft/api-extractor": "^7.29.5", "ajv": "^8.17.1", "async-done": "^2.0.0", - "chai": "^5.1.1", + "chai": "^6.0.1", "concurrently": "^9.0.1", "eslint": "^9.15.0", "eslint-config-google": "^0.14.0", diff --git a/tests/mocha/block_json_test.js b/tests/mocha/block_json_test.js index 4baccef6b7b..31abd6e3484 100644 --- a/tests/mocha/block_json_test.js +++ b/tests/mocha/block_json_test.js @@ -5,7 +5,7 @@ */ import {Align} from '../../build/src/core/inputs/align.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/block_test.js b/tests/mocha/block_test.js index e3bd470902d..1f8f9b1ee41 100644 --- a/tests/mocha/block_test.js +++ b/tests/mocha/block_test.js @@ -11,7 +11,7 @@ import {IconType} from '../../build/src/core/icons/icon_types.js'; import {EndRowInput} from '../../build/src/core/inputs/end_row_input.js'; import {isCommentIcon} from '../../build/src/core/interfaces/i_comment_icon.js'; import {Size} from '../../build/src/core/utils/size.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import {createRenderedBlock} from './test_helpers/block_definitions.js'; import { createChangeListenerSpy, diff --git a/tests/mocha/blocks/lists_test.js b/tests/mocha/blocks/lists_test.js index 490109d22ca..e749fae90a7 100644 --- a/tests/mocha/blocks/lists_test.js +++ b/tests/mocha/blocks/lists_test.js @@ -5,7 +5,7 @@ */ import {ConnectionType} from '../../../build/src/core/connection_type.js'; -import {assert} from '../../../node_modules/chai/chai.js'; +import {assert} from '../../../node_modules/chai/index.js'; import {defineStatementBlock} from '../test_helpers/block_definitions.js'; import {runSerializationTestSuite} from '../test_helpers/serialization.js'; import { diff --git a/tests/mocha/blocks/logic_ternary_test.js b/tests/mocha/blocks/logic_ternary_test.js index 71920935981..3d343a7caec 100644 --- a/tests/mocha/blocks/logic_ternary_test.js +++ b/tests/mocha/blocks/logic_ternary_test.js @@ -5,7 +5,7 @@ */ import * as eventUtils from '../../../build/src/core/events/utils.js'; -import {assert} from '../../../node_modules/chai/chai.js'; +import {assert} from '../../../node_modules/chai/index.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 f8d74916c29..eb040c884a7 100644 --- a/tests/mocha/blocks/loops_test.js +++ b/tests/mocha/blocks/loops_test.js @@ -5,7 +5,7 @@ */ import * as Blockly from '../../../build/src/core/blockly.js'; -import {assert} from '../../../node_modules/chai/chai.js'; +import {assert} from '../../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/blocks/procedures_test.js b/tests/mocha/blocks/procedures_test.js index 4b20662cf93..5ac651fe4cd 100644 --- a/tests/mocha/blocks/procedures_test.js +++ b/tests/mocha/blocks/procedures_test.js @@ -5,7 +5,7 @@ */ import * as Blockly from '../../../build/src/core/blockly.js'; -import {assert} from '../../../node_modules/chai/chai.js'; +import {assert} from '../../../node_modules/chai/index.js'; import {defineRowBlock} from '../test_helpers/block_definitions.js'; import { assertCallBlockStructure, diff --git a/tests/mocha/blocks/variables_test.js b/tests/mocha/blocks/variables_test.js index d12691dd476..a317fe11b52 100644 --- a/tests/mocha/blocks/variables_test.js +++ b/tests/mocha/blocks/variables_test.js @@ -5,7 +5,7 @@ */ import {nameUsedWithConflictingParam} from '../../../build/src/core/variables.js'; -import {assert} from '../../../node_modules/chai/chai.js'; +import {assert} from '../../../node_modules/chai/index.js'; import { MockParameterModelWithVar, MockProcedureModel, diff --git a/tests/mocha/clipboard_test.js b/tests/mocha/clipboard_test.js index 5a513b44a9e..ff49c0e303c 100644 --- a/tests/mocha/clipboard_test.js +++ b/tests/mocha/clipboard_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { assertEventFired, createChangeListenerSpy, diff --git a/tests/mocha/comment_deserialization_test.js b/tests/mocha/comment_deserialization_test.js index 54ee0b2ff30..f834eb0f301 100644 --- a/tests/mocha/comment_deserialization_test.js +++ b/tests/mocha/comment_deserialization_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/comment_test.js b/tests/mocha/comment_test.js index 0ff1c239e30..1f52df8fd52 100644 --- a/tests/mocha/comment_test.js +++ b/tests/mocha/comment_test.js @@ -5,7 +5,7 @@ */ import {EventType} from '../../build/src/core/events/type.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import {assertEventFired} from './test_helpers/events.js'; import { sharedTestSetup, diff --git a/tests/mocha/comment_view_test.js b/tests/mocha/comment_view_test.js index 57a24742457..a60a7a973ff 100644 --- a/tests/mocha/comment_view_test.js +++ b/tests/mocha/comment_view_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/connection_checker_test.js b/tests/mocha/connection_checker_test.js index fee2966d766..bdbcb70a6ec 100644 --- a/tests/mocha/connection_checker_test.js +++ b/tests/mocha/connection_checker_test.js @@ -5,7 +5,7 @@ */ import {ConnectionType} from '../../build/src/core/connection_type.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/connection_db_test.js b/tests/mocha/connection_db_test.js index 04f685124ca..459c59e3ab4 100644 --- a/tests/mocha/connection_db_test.js +++ b/tests/mocha/connection_db_test.js @@ -6,7 +6,7 @@ import {ConnectionType} from '../../build/src/core/connection_type.js'; import * as idGenerator from '../../build/src/core/utils/idgenerator.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/connection_test.js b/tests/mocha/connection_test.js index cefea1784e7..b36f358eac3 100644 --- a/tests/mocha/connection_test.js +++ b/tests/mocha/connection_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { defineRowBlock, defineStackBlock, diff --git a/tests/mocha/contextmenu_items_test.js b/tests/mocha/contextmenu_items_test.js index d9044ec7e28..08ab5d5267b 100644 --- a/tests/mocha/contextmenu_items_test.js +++ b/tests/mocha/contextmenu_items_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/contextmenu_test.js b/tests/mocha/contextmenu_test.js index 65896112bb1..df5bf79dc35 100644 --- a/tests/mocha/contextmenu_test.js +++ b/tests/mocha/contextmenu_test.js @@ -6,7 +6,7 @@ import {callbackFactory} from '../../build/src/core/contextmenu.js'; import * as xmlUtils from '../../build/src/core/utils/xml.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/cursor_test.js b/tests/mocha/cursor_test.js index 6f841ae09c6..02426ae26b8 100644 --- a/tests/mocha/cursor_test.js +++ b/tests/mocha/cursor_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import {createRenderedBlock} from './test_helpers/block_definitions.js'; import { sharedTestSetup, diff --git a/tests/mocha/dialog_test.js b/tests/mocha/dialog_test.js index f250ff0f8aa..7d4147d83f8 100644 --- a/tests/mocha/dialog_test.js +++ b/tests/mocha/dialog_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/dropdowndiv_test.js b/tests/mocha/dropdowndiv_test.js index fc792fbaf24..495237f18bc 100644 --- a/tests/mocha/dropdowndiv_test.js +++ b/tests/mocha/dropdowndiv_test.js @@ -6,7 +6,7 @@ import {Rect} from '../../build/src/core/utils/rect.js'; import * as style from '../../build/src/core/utils/style.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/event_block_change_test.js b/tests/mocha/event_block_change_test.js index 7de0a23b607..9e1f9c3103e 100644 --- a/tests/mocha/event_block_change_test.js +++ b/tests/mocha/event_block_change_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import {defineMutatorBlocks} from './test_helpers/block_definitions.js'; import { sharedTestSetup, diff --git a/tests/mocha/event_block_create_test.js b/tests/mocha/event_block_create_test.js index f59f9435efd..1672b56bb98 100644 --- a/tests/mocha/event_block_create_test.js +++ b/tests/mocha/event_block_create_test.js @@ -5,7 +5,7 @@ */ import {EventType} from '../../build/src/core/events/type.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import {defineRowBlock} from './test_helpers/block_definitions.js'; import {assertEventFired} from './test_helpers/events.js'; import { diff --git a/tests/mocha/event_block_delete_test.js b/tests/mocha/event_block_delete_test.js index d74b6aa062b..e2fb5b8ce88 100644 --- a/tests/mocha/event_block_delete_test.js +++ b/tests/mocha/event_block_delete_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import {defineRowBlock} from './test_helpers/block_definitions.js'; import { sharedTestSetup, diff --git a/tests/mocha/event_block_drag_test.js b/tests/mocha/event_block_drag_test.js index 9b0f2031ad0..cc71e3bf084 100644 --- a/tests/mocha/event_block_drag_test.js +++ b/tests/mocha/event_block_drag_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import {defineRowBlock} from './test_helpers/block_definitions.js'; import { sharedTestSetup, diff --git a/tests/mocha/event_block_field_intermediate_change_test.js b/tests/mocha/event_block_field_intermediate_change_test.js index 0ff4e1bbf3c..d917dadcdd5 100644 --- a/tests/mocha/event_block_field_intermediate_change_test.js +++ b/tests/mocha/event_block_field_intermediate_change_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/event_block_move_test.js b/tests/mocha/event_block_move_test.js index b93457e14c1..6d1890eebeb 100644 --- a/tests/mocha/event_block_move_test.js +++ b/tests/mocha/event_block_move_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import {defineRowBlock} from './test_helpers/block_definitions.js'; import { sharedTestSetup, diff --git a/tests/mocha/event_bubble_open_test.js b/tests/mocha/event_bubble_open_test.js index 099a625f6e2..a445a6a7819 100644 --- a/tests/mocha/event_bubble_open_test.js +++ b/tests/mocha/event_bubble_open_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import {defineMutatorBlocks} from './test_helpers/block_definitions.js'; import { sharedTestSetup, diff --git a/tests/mocha/event_click_test.js b/tests/mocha/event_click_test.js index 6e18769485b..5c4afbcadf9 100644 --- a/tests/mocha/event_click_test.js +++ b/tests/mocha/event_click_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import {defineRowBlock} from './test_helpers/block_definitions.js'; import { sharedTestSetup, diff --git a/tests/mocha/event_comment_change_test.js b/tests/mocha/event_comment_change_test.js index ed5f4d9f6ae..edb539ef555 100644 --- a/tests/mocha/event_comment_change_test.js +++ b/tests/mocha/event_comment_change_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/event_comment_collapse_test.js b/tests/mocha/event_comment_collapse_test.js index e2d27530708..5c3f61054a1 100644 --- a/tests/mocha/event_comment_collapse_test.js +++ b/tests/mocha/event_comment_collapse_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/event_comment_create_test.js b/tests/mocha/event_comment_create_test.js index df919541d95..71ef8ed1b75 100644 --- a/tests/mocha/event_comment_create_test.js +++ b/tests/mocha/event_comment_create_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/event_comment_delete_test.js b/tests/mocha/event_comment_delete_test.js index 2e2bb45c491..dd9f0dd2286 100644 --- a/tests/mocha/event_comment_delete_test.js +++ b/tests/mocha/event_comment_delete_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/event_comment_drag_test.js b/tests/mocha/event_comment_drag_test.js index d214e0adba1..f6685cc5bdf 100644 --- a/tests/mocha/event_comment_drag_test.js +++ b/tests/mocha/event_comment_drag_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/event_comment_move_test.js b/tests/mocha/event_comment_move_test.js index aae3fdfe632..b3acea990a6 100644 --- a/tests/mocha/event_comment_move_test.js +++ b/tests/mocha/event_comment_move_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/event_comment_resize_test.js b/tests/mocha/event_comment_resize_test.js index b74e1abb2bf..bed3e733a65 100644 --- a/tests/mocha/event_comment_resize_test.js +++ b/tests/mocha/event_comment_resize_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/event_selected_test.js b/tests/mocha/event_selected_test.js index 1ce8306db48..8731099ec96 100644 --- a/tests/mocha/event_selected_test.js +++ b/tests/mocha/event_selected_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import {defineRowBlock} from './test_helpers/block_definitions.js'; import { sharedTestSetup, diff --git a/tests/mocha/event_test.js b/tests/mocha/event_test.js index 7423f22f74b..a5019c8a978 100644 --- a/tests/mocha/event_test.js +++ b/tests/mocha/event_test.js @@ -6,7 +6,7 @@ import * as Blockly from '../../build/src/core/blockly.js'; import * as eventUtils from '../../build/src/core/events/utils.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { assertEventEquals, assertNthCallEventArgEquals, diff --git a/tests/mocha/event_theme_change_test.js b/tests/mocha/event_theme_change_test.js index f20f745b6a0..396347c9e13 100644 --- a/tests/mocha/event_theme_change_test.js +++ b/tests/mocha/event_theme_change_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/event_toolbox_item_select_test.js b/tests/mocha/event_toolbox_item_select_test.js index bf6a9a46212..02484c35bc1 100644 --- a/tests/mocha/event_toolbox_item_select_test.js +++ b/tests/mocha/event_toolbox_item_select_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/event_trashcan_open_test.js b/tests/mocha/event_trashcan_open_test.js index 2c809f2dfad..47da09a075a 100644 --- a/tests/mocha/event_trashcan_open_test.js +++ b/tests/mocha/event_trashcan_open_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/event_var_create_test.js b/tests/mocha/event_var_create_test.js index e374c496541..79af41281de 100644 --- a/tests/mocha/event_var_create_test.js +++ b/tests/mocha/event_var_create_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/event_var_delete_test.js b/tests/mocha/event_var_delete_test.js index b06943d9a19..93d9ef0ba2d 100644 --- a/tests/mocha/event_var_delete_test.js +++ b/tests/mocha/event_var_delete_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/event_var_rename_test.js b/tests/mocha/event_var_rename_test.js index 7fbd185ab7b..b6d77cb35bd 100644 --- a/tests/mocha/event_var_rename_test.js +++ b/tests/mocha/event_var_rename_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/event_var_type_change_test.js b/tests/mocha/event_var_type_change_test.js index d19b0421a33..066c145a3ef 100644 --- a/tests/mocha/event_var_type_change_test.js +++ b/tests/mocha/event_var_type_change_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/event_viewport_test.js b/tests/mocha/event_viewport_test.js index edacc0da6cb..cd11079fa32 100644 --- a/tests/mocha/event_viewport_test.js +++ b/tests/mocha/event_viewport_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/extensions_test.js b/tests/mocha/extensions_test.js index 66772cbea4b..8c41861d5d8 100644 --- a/tests/mocha/extensions_test.js +++ b/tests/mocha/extensions_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/field_checkbox_test.js b/tests/mocha/field_checkbox_test.js index 08190fed823..74357338a5a 100644 --- a/tests/mocha/field_checkbox_test.js +++ b/tests/mocha/field_checkbox_test.js @@ -5,7 +5,7 @@ */ import * as Blockly from '../../build/src/core/blockly.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import {defineRowBlock} from './test_helpers/block_definitions.js'; import { assertFieldValue, diff --git a/tests/mocha/field_colour_test.js b/tests/mocha/field_colour_test.js index 262f978f29d..975d5a01d4a 100644 --- a/tests/mocha/field_colour_test.js +++ b/tests/mocha/field_colour_test.js @@ -5,7 +5,7 @@ */ import * as Blockly from '../../build/src/core/blockly.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { createTestBlock, defineRowBlock, diff --git a/tests/mocha/field_dropdown_test.js b/tests/mocha/field_dropdown_test.js index e9bc159146d..a1731e81281 100644 --- a/tests/mocha/field_dropdown_test.js +++ b/tests/mocha/field_dropdown_test.js @@ -5,7 +5,7 @@ */ import * as Blockly from '../../build/src/core/blockly.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { createTestBlock, defineRowBlock, diff --git a/tests/mocha/field_image_test.js b/tests/mocha/field_image_test.js index a02b3f6b64a..f0358703bdf 100644 --- a/tests/mocha/field_image_test.js +++ b/tests/mocha/field_image_test.js @@ -5,7 +5,7 @@ */ import * as Blockly from '../../build/src/core/blockly.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { assertFieldValue, runConstructorSuiteTests, diff --git a/tests/mocha/field_label_serializable_test.js b/tests/mocha/field_label_serializable_test.js index a831713412c..443cc6d1753 100644 --- a/tests/mocha/field_label_serializable_test.js +++ b/tests/mocha/field_label_serializable_test.js @@ -5,7 +5,7 @@ */ import * as Blockly from '../../build/src/core/blockly.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { createTestBlock, defineRowBlock, diff --git a/tests/mocha/field_label_test.js b/tests/mocha/field_label_test.js index cf5b4904493..bae600aff19 100644 --- a/tests/mocha/field_label_test.js +++ b/tests/mocha/field_label_test.js @@ -5,7 +5,7 @@ */ import * as Blockly from '../../build/src/core/blockly.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import {createTestBlock} from './test_helpers/block_definitions.js'; import { assertFieldValue, diff --git a/tests/mocha/field_number_test.js b/tests/mocha/field_number_test.js index 768766bf013..3c12fed820d 100644 --- a/tests/mocha/field_number_test.js +++ b/tests/mocha/field_number_test.js @@ -5,7 +5,7 @@ */ import * as Blockly from '../../build/src/core/blockly.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import {defineRowBlock} from './test_helpers/block_definitions.js'; import {runTestCases} from './test_helpers/common.js'; import { diff --git a/tests/mocha/field_registry_test.js b/tests/mocha/field_registry_test.js index 26b33c16c3d..1f19477dee1 100644 --- a/tests/mocha/field_registry_test.js +++ b/tests/mocha/field_registry_test.js @@ -5,7 +5,7 @@ */ import * as Blockly from '../../build/src/core/blockly.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/field_test.js b/tests/mocha/field_test.js index 38f9662d6d6..422b0473418 100644 --- a/tests/mocha/field_test.js +++ b/tests/mocha/field_test.js @@ -5,7 +5,7 @@ */ import * as Blockly from '../../build/src/core/blockly.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { addBlockTypeToCleanup, addMessageToCleanup, diff --git a/tests/mocha/field_textinput_test.js b/tests/mocha/field_textinput_test.js index 7dc105f72f0..7cafd00d948 100644 --- a/tests/mocha/field_textinput_test.js +++ b/tests/mocha/field_textinput_test.js @@ -5,7 +5,7 @@ */ import * as Blockly from '../../build/src/core/blockly.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { createTestBlock, defineRowBlock, diff --git a/tests/mocha/field_variable_test.js b/tests/mocha/field_variable_test.js index 2dc8d35a55c..58a20977521 100644 --- a/tests/mocha/field_variable_test.js +++ b/tests/mocha/field_variable_test.js @@ -5,7 +5,7 @@ */ import * as Blockly from '../../build/src/core/blockly.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { createTestBlock, defineRowBlock, diff --git a/tests/mocha/flyout_test.js b/tests/mocha/flyout_test.js index f6d3019df55..998279a0874 100644 --- a/tests/mocha/flyout_test.js +++ b/tests/mocha/flyout_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/focus_manager_test.js b/tests/mocha/focus_manager_test.js index 26dcb8dbe68..490fa4301b8 100644 --- a/tests/mocha/focus_manager_test.js +++ b/tests/mocha/focus_manager_test.js @@ -8,7 +8,7 @@ import { FocusManager, getFocusManager, } from '../../build/src/core/focus_manager.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/focusable_tree_traverser_test.js b/tests/mocha/focusable_tree_traverser_test.js index 0f88e1106f9..a384dd4be45 100644 --- a/tests/mocha/focusable_tree_traverser_test.js +++ b/tests/mocha/focusable_tree_traverser_test.js @@ -6,7 +6,7 @@ import {FocusManager} from '../../build/src/core/focus_manager.js'; import {FocusableTreeTraverser} from '../../build/src/core/utils/focusable_tree_traverser.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/generator_test.js b/tests/mocha/generator_test.js index 527448eacc9..3c377e7c1ab 100644 --- a/tests/mocha/generator_test.js +++ b/tests/mocha/generator_test.js @@ -10,7 +10,7 @@ import {JavascriptGenerator} from '../../build/src/generators/javascript/javascr 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 {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/gesture_test.js b/tests/mocha/gesture_test.js index 3f53b8894b9..af4c599fea3 100644 --- a/tests/mocha/gesture_test.js +++ b/tests/mocha/gesture_test.js @@ -5,7 +5,7 @@ */ import {EventType} from '../../build/src/core/events/type.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import {defineBasicBlockWithField} from './test_helpers/block_definitions.js'; import {assertEventFired, assertEventNotFired} from './test_helpers/events.js'; import { diff --git a/tests/mocha/icon_test.js b/tests/mocha/icon_test.js index 5855fcfc576..ba1b7116065 100644 --- a/tests/mocha/icon_test.js +++ b/tests/mocha/icon_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import {defineEmptyBlock} from './test_helpers/block_definitions.js'; import {MockIcon, MockSerializableIcon} from './test_helpers/icon_mocks.js'; import { diff --git a/tests/mocha/input_test.js b/tests/mocha/input_test.js index 0c2b0973eaf..dfa30858e0e 100644 --- a/tests/mocha/input_test.js +++ b/tests/mocha/input_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/insertion_marker_test.js b/tests/mocha/insertion_marker_test.js index 9ccf8a00b0f..f8215a847eb 100644 --- a/tests/mocha/insertion_marker_test.js +++ b/tests/mocha/insertion_marker_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/jso_deserialization_test.js b/tests/mocha/jso_deserialization_test.js index dfd3e62b7f2..f6b47d7de6a 100644 --- a/tests/mocha/jso_deserialization_test.js +++ b/tests/mocha/jso_deserialization_test.js @@ -5,7 +5,7 @@ */ import {EventType} from '../../build/src/core/events/type.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import {assertEventFired} from './test_helpers/events.js'; import { MockParameterModel, diff --git a/tests/mocha/jso_serialization_test.js b/tests/mocha/jso_serialization_test.js index 7cf415e676a..4a7d5e9e1d3 100644 --- a/tests/mocha/jso_serialization_test.js +++ b/tests/mocha/jso_serialization_test.js @@ -5,7 +5,7 @@ */ import * as Blockly from '../../build/src/core/blockly.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { defineRowBlock, defineStackBlock, diff --git a/tests/mocha/json_test.js b/tests/mocha/json_test.js index 471d2fb9711..2e4b68df9ec 100644 --- a/tests/mocha/json_test.js +++ b/tests/mocha/json_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { addMessageToCleanup, sharedTestSetup, diff --git a/tests/mocha/keyboard_navigation_controller_test.js b/tests/mocha/keyboard_navigation_controller_test.js index c7abd863ec1..dd81e9e4b45 100644 --- a/tests/mocha/keyboard_navigation_controller_test.js +++ b/tests/mocha/keyboard_navigation_controller_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/layering_test.js b/tests/mocha/layering_test.js index 1ef0ee6973d..b84f23252b3 100644 --- a/tests/mocha/layering_test.js +++ b/tests/mocha/layering_test.js @@ -3,7 +3,7 @@ * Copyright 2023 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/metrics_test.js b/tests/mocha/metrics_test.js index 860e802550d..de9a5641ad7 100644 --- a/tests/mocha/metrics_test.js +++ b/tests/mocha/metrics_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/mutator_test.js b/tests/mocha/mutator_test.js index fb6d8caf09b..72b17d0a4bb 100644 --- a/tests/mocha/mutator_test.js +++ b/tests/mocha/mutator_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { createRenderedBlock, defineMutatorBlocks, diff --git a/tests/mocha/names_test.js b/tests/mocha/names_test.js index 732e28cd57a..e449a59fd6c 100644 --- a/tests/mocha/names_test.js +++ b/tests/mocha/names_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/navigation_test.js b/tests/mocha/navigation_test.js index 5bed2aaab8c..38dc88894b1 100644 --- a/tests/mocha/navigation_test.js +++ b/tests/mocha/navigation_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/old_workspace_comment_test.js b/tests/mocha/old_workspace_comment_test.js index 08a2523f50e..5038d67bad8 100644 --- a/tests/mocha/old_workspace_comment_test.js +++ b/tests/mocha/old_workspace_comment_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/procedure_map_test.js b/tests/mocha/procedure_map_test.js index eebd5a9f326..5e29c6ca050 100644 --- a/tests/mocha/procedure_map_test.js +++ b/tests/mocha/procedure_map_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import {MockProcedureModel} from './test_helpers/procedures.js'; import { sharedTestSetup, diff --git a/tests/mocha/rect_test.js b/tests/mocha/rect_test.js index 37712dff3a0..652837eaef6 100644 --- a/tests/mocha/rect_test.js +++ b/tests/mocha/rect_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/registry_test.js b/tests/mocha/registry_test.js index 6bcb8b5b077..2d5e22543ca 100644 --- a/tests/mocha/registry_test.js +++ b/tests/mocha/registry_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/render_management_test.js b/tests/mocha/render_management_test.js index 4de0635394b..94fa48805cf 100644 --- a/tests/mocha/render_management_test.js +++ b/tests/mocha/render_management_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/serializer_test.js b/tests/mocha/serializer_test.js index a3a3761e9c6..efd1f308b01 100644 --- a/tests/mocha/serializer_test.js +++ b/tests/mocha/serializer_test.js @@ -5,7 +5,7 @@ */ import * as Blockly from '../../build/src/core/blockly.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { TestCase, TestSuite, diff --git a/tests/mocha/shortcut_items_test.js b/tests/mocha/shortcut_items_test.js index d96ddbfeadc..dfbae3f0901 100644 --- a/tests/mocha/shortcut_items_test.js +++ b/tests/mocha/shortcut_items_test.js @@ -5,7 +5,7 @@ */ import * as Blockly from '../../build/src/core/blockly.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import {defineStackBlock} from './test_helpers/block_definitions.js'; import { sharedTestSetup, diff --git a/tests/mocha/shortcut_registry_test.js b/tests/mocha/shortcut_registry_test.js index 5641e17c7d1..a06f01b9c00 100644 --- a/tests/mocha/shortcut_registry_test.js +++ b/tests/mocha/shortcut_registry_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import {createTestBlock} from './test_helpers/block_definitions.js'; import { sharedTestSetup, diff --git a/tests/mocha/test_helpers/code_generation.js b/tests/mocha/test_helpers/code_generation.js index 95bd902cd45..e61a45653b2 100644 --- a/tests/mocha/test_helpers/code_generation.js +++ b/tests/mocha/test_helpers/code_generation.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../../node_modules/chai/chai.js'; +import {assert} from '../../../node_modules/chai/index.js'; import {runTestSuites} from './common.js'; /** diff --git a/tests/mocha/test_helpers/events.js b/tests/mocha/test_helpers/events.js index c074bdd77a4..3e0b1e95d8b 100644 --- a/tests/mocha/test_helpers/events.js +++ b/tests/mocha/test_helpers/events.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../../node_modules/chai/chai.js'; +import {assert} from '../../../node_modules/chai/index.js'; /** * Creates spy for workspace fireChangeListener diff --git a/tests/mocha/test_helpers/fields.js b/tests/mocha/test_helpers/fields.js index e082abb4ccc..ab304a808a7 100644 --- a/tests/mocha/test_helpers/fields.js +++ b/tests/mocha/test_helpers/fields.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../../node_modules/chai/chai.js'; +import {assert} from '../../../node_modules/chai/index.js'; import {runTestCases, TestCase} from './common.js'; /** diff --git a/tests/mocha/test_helpers/procedures.js b/tests/mocha/test_helpers/procedures.js index ecf8c13adcc..16ef973350f 100644 --- a/tests/mocha/test_helpers/procedures.js +++ b/tests/mocha/test_helpers/procedures.js @@ -6,7 +6,7 @@ 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'; +import {assert} from '../../../node_modules/chai/index.js'; /** * Asserts that the procedure definition or call block has the expected var diff --git a/tests/mocha/test_helpers/serialization.js b/tests/mocha/test_helpers/serialization.js index c99f508d4dc..c476eae3d6f 100644 --- a/tests/mocha/test_helpers/serialization.js +++ b/tests/mocha/test_helpers/serialization.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../../node_modules/chai/chai.js'; +import {assert} from '../../../node_modules/chai/index.js'; import {runTestCases} from './common.js'; /** diff --git a/tests/mocha/test_helpers/variables.js b/tests/mocha/test_helpers/variables.js index 83f175f6327..dd19b4904c9 100644 --- a/tests/mocha/test_helpers/variables.js +++ b/tests/mocha/test_helpers/variables.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../../node_modules/chai/chai.js'; +import {assert} from '../../../node_modules/chai/index.js'; /** * Check if a variable with the given values exists. diff --git a/tests/mocha/test_helpers/warnings.js b/tests/mocha/test_helpers/warnings.js index 0e07f846c5a..d718a25c166 100644 --- a/tests/mocha/test_helpers/warnings.js +++ b/tests/mocha/test_helpers/warnings.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../../node_modules/chai/chai.js'; +import {assert} from '../../../node_modules/chai/index.js'; /** * Captures the strings sent to console.warn() when calling a function. diff --git a/tests/mocha/test_helpers/workspace.js b/tests/mocha/test_helpers/workspace.js index 917ce6f629e..b5f3cadabd3 100644 --- a/tests/mocha/test_helpers/workspace.js +++ b/tests/mocha/test_helpers/workspace.js @@ -5,7 +5,7 @@ */ import * as eventUtils from '../../../build/src/core/events/utils.js'; -import {assert} from '../../../node_modules/chai/chai.js'; +import {assert} from '../../../node_modules/chai/index.js'; import {workspaceTeardown} from './setup_teardown.js'; import {assertVariableValues} from './variables.js'; import {assertWarnings} from './warnings.js'; diff --git a/tests/mocha/theme_test.js b/tests/mocha/theme_test.js index 1f425dca6a3..f54641a348f 100644 --- a/tests/mocha/theme_test.js +++ b/tests/mocha/theme_test.js @@ -5,7 +5,7 @@ */ import {EventType} from '../../build/src/core/events/type.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import {assertEventFired} from './test_helpers/events.js'; import { sharedTestSetup, diff --git a/tests/mocha/toast_test.js b/tests/mocha/toast_test.js index 45e02ad5de8..afb7f7f6cb9 100644 --- a/tests/mocha/toast_test.js +++ b/tests/mocha/toast_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/toolbox_test.js b/tests/mocha/toolbox_test.js index 4e92cd28fd3..480fdfdc6fc 100644 --- a/tests/mocha/toolbox_test.js +++ b/tests/mocha/toolbox_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import {defineStackBlock} from './test_helpers/block_definitions.js'; import { sharedTestSetup, diff --git a/tests/mocha/tooltip_test.js b/tests/mocha/tooltip_test.js index 1edc8ad6e25..0695b9ebe03 100644 --- a/tests/mocha/tooltip_test.js +++ b/tests/mocha/tooltip_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/touch_test.js b/tests/mocha/touch_test.js index 775665643b7..30a9fe72724 100644 --- a/tests/mocha/touch_test.js +++ b/tests/mocha/touch_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/trashcan_test.js b/tests/mocha/trashcan_test.js index 5486326f1e0..d96e00f3a21 100644 --- a/tests/mocha/trashcan_test.js +++ b/tests/mocha/trashcan_test.js @@ -6,7 +6,7 @@ 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 {assert} from '../../node_modules/chai/index.js'; import { defineBasicBlockWithField, defineMutatorBlocks, diff --git a/tests/mocha/utils_test.js b/tests/mocha/utils_test.js index b6228448db7..accf164b79b 100644 --- a/tests/mocha/utils_test.js +++ b/tests/mocha/utils_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/variable_map_test.js b/tests/mocha/variable_map_test.js index 2d6cee0b94a..76dffbe9dc7 100644 --- a/tests/mocha/variable_map_test.js +++ b/tests/mocha/variable_map_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { assertEventFired, assertEventNotFired, diff --git a/tests/mocha/variable_model_test.js b/tests/mocha/variable_model_test.js index cd2a89db420..eee7ea9bf41 100644 --- a/tests/mocha/variable_model_test.js +++ b/tests/mocha/variable_model_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/widget_div_test.js b/tests/mocha/widget_div_test.js index 61c94247110..4ad31f96c72 100644 --- a/tests/mocha/widget_div_test.js +++ b/tests/mocha/widget_div_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/workspace_comment_test.js b/tests/mocha/workspace_comment_test.js index 3ce276e8579..bb87ad82ac6 100644 --- a/tests/mocha/workspace_comment_test.js +++ b/tests/mocha/workspace_comment_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { assertEventFired, createChangeListenerSpy, diff --git a/tests/mocha/workspace_svg_test.js b/tests/mocha/workspace_svg_test.js index 207cad45dc7..6193dda2db7 100644 --- a/tests/mocha/workspace_svg_test.js +++ b/tests/mocha/workspace_svg_test.js @@ -5,7 +5,7 @@ */ import {EventType} from '../../build/src/core/events/type.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import {defineStackBlock} from './test_helpers/block_definitions.js'; import { assertEventFired, diff --git a/tests/mocha/xml_test.js b/tests/mocha/xml_test.js index 218324197bf..cd1bce128bb 100644 --- a/tests/mocha/xml_test.js +++ b/tests/mocha/xml_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import { addBlockTypeToCleanup, createGenUidStubWithReturns, diff --git a/tests/mocha/zoom_controls_test.js b/tests/mocha/zoom_controls_test.js index dedc36b75b4..d9bb0f91e9b 100644 --- a/tests/mocha/zoom_controls_test.js +++ b/tests/mocha/zoom_controls_test.js @@ -5,7 +5,7 @@ */ import {EventType} from '../../build/src/core/events/type.js'; -import {assert} from '../../node_modules/chai/chai.js'; +import {assert} from '../../node_modules/chai/index.js'; import {assertEventFired, assertEventNotFired} from './test_helpers/events.js'; import { sharedTestSetup, From e5eada84318c8f85f8a8ff83556691423c2e7f5d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Aug 2025 19:12:06 +0100 Subject: [PATCH 13/29] chore(deps): bump eslint from 9.30.0 to 9.34.0 (#9329) Bumps [eslint](https://github.com/eslint/eslint) from 9.30.0 to 9.34.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/v9.30.0...v9.34.0) --- updated-dependencies: - dependency-name: eslint dependency-version: 9.34.0 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 | 60 +++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 33 deletions(-) diff --git a/package-lock.json b/package-lock.json index 287be1f1f97..345e4271927 100644 --- a/package-lock.json +++ b/package-lock.json @@ -445,19 +445,21 @@ } }, "node_modules/@eslint/config-helpers": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.3.0.tgz", - "integrity": "sha512-ViuymvFmcJi04qdZeDc2whTHryouGcDlaxPqarTD0ZE10ISpxGUVZGZDx4w01upyIynL3iu6IXH2bS1NhclQMw==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.3.1.tgz", + "integrity": "sha512-xR93k9WhrDYpXHORXpxVL5oHj3Era7wo6k/Wd8/IsQNnZUTzkGS29lyn3nAT05v6ltUuTFVCCYDEGfy2Or/sPA==", "dev": true, + "license": "Apache-2.0", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/core": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.14.0.tgz", - "integrity": "sha512-qIbV0/JZr7iSDjqAc60IqbLdsj9GDt16xQtWD+B78d/HAlvysGdZZ6rpJHGAc2T0FQx1X6thsSPdnoiGKdNtdg==", + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.15.2.tgz", + "integrity": "sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg==", "dev": true, + "license": "Apache-2.0", "dependencies": { "@types/json-schema": "^7.0.15" }, @@ -527,10 +529,11 @@ "license": "MIT" }, "node_modules/@eslint/js": { - "version": "9.30.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.30.0.tgz", - "integrity": "sha512-Wzw3wQwPvc9sHM+NjakWTcPx11mbZyiYHuwWa/QfZ7cIRX7WK54PSk7bdyXDaoaopUcMatv1zaQvOAAO8hCdww==", + "version": "9.34.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.34.0.tgz", + "integrity": "sha512-EoyvqQnBNsV1CWaEJ559rxXL4c8V92gxirbawSmVUOWXlsRxxQXl6LmCpdUblgxgSkDIqKnhzba2SjRTI/A5Rw==", "dev": true, + "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -548,30 +551,19 @@ } }, "node_modules/@eslint/plugin-kit": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.3.tgz", - "integrity": "sha512-1+WqvgNMhmlAambTvT3KPtCl/Ibr68VldY2XY40SL1CE0ZXiakFR/cbTspaF5HsnpDMvcYYoJHfl4980NBjGag==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.5.tgz", + "integrity": "sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "@eslint/core": "^0.15.1", + "@eslint/core": "^0.15.2", "levn": "^0.4.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@eslint/plugin-kit/node_modules/@eslint/core": { - "version": "0.15.1", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.15.1.tgz", - "integrity": "sha512-bkOp+iumZCCbt1K1CmWf0R9pM5yKpDv+ZXtvSyQpudrI9kuFLp+bM2WOPXImuD/ceQuaa8f5pj93Y7zyECIGNA==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.15" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, "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", @@ -1528,7 +1520,8 @@ "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 + "dev": true, + "license": "MIT" }, "node_modules/@types/node": { "version": "20.16.3", @@ -3970,19 +3963,20 @@ } }, "node_modules/eslint": { - "version": "9.30.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.30.0.tgz", - "integrity": "sha512-iN/SiPxmQu6EVkf+m1qpBxzUhE12YqFLOSySuOyVLJLEF9nzTf+h/1AJYc1JWzCnktggeNrjvQGLngDzXirU6g==", + "version": "9.34.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.34.0.tgz", + "integrity": "sha512-RNCHRX5EwdrESy3Jc9o8ie8Bog+PeYvvSR8sDGoZxNFTvZ4dlxUB3WzQ3bQMztFrSRODGrLLj8g6OFuGY/aiQg==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", "@eslint/config-array": "^0.21.0", - "@eslint/config-helpers": "^0.3.0", - "@eslint/core": "^0.14.0", + "@eslint/config-helpers": "^0.3.1", + "@eslint/core": "^0.15.2", "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "9.30.0", - "@eslint/plugin-kit": "^0.3.1", + "@eslint/js": "9.34.0", + "@eslint/plugin-kit": "^0.3.5", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", From 3d28ca8448df4d496090f6828ee1a8276c0b87da Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Wed, 27 Aug 2025 19:18:20 +0100 Subject: [PATCH 14/29] chore: Add node.js v24 to CI build matrix (#9219) Node.js v24 has now been released, so add it to our build matrix. Node v18 is no longer in LTS but we want to continue to test on it until it is removed from package.json engines. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d7a4e786ce6..cdec5308279 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: # TODO (#2114): re-enable osx build. # os: [ubuntu-latest, macos-latest] os: [ubuntu-latest] - node-version: [18.x, 20.x, 22.x] + node-version: [18.x, 20.x, 22.x, 24.x] # See supported Node.js release schedule at # https://nodejs.org/en/about/releases/ From b2bbe965ba621e17f100787b3aa72fbfaab21dea Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Wed, 27 Aug 2025 12:28:06 -0700 Subject: [PATCH 15/29] fix: Prevent mocha tests failures when window does not have focus. (#9332) * chore: Add puppeteer-core as a dev dependency. * fix: Make mocha tests run in a fake-focused window. * fix: Make `test:mocha:interactive` use the same gulp codepath as `test`. --- gulpfile.mjs | 7 ++- package-lock.json | 89 +++++++++++++++++++++++++++----- package.json | 3 +- scripts/gulpfiles/test_tasks.mjs | 12 ++++- tests/mocha/webdriver.js | 18 ++++++- 5 files changed, 111 insertions(+), 18 deletions(-) diff --git a/gulpfile.mjs b/gulpfile.mjs index fd3de3bde8c..ad61bcb516d 100644 --- a/gulpfile.mjs +++ b/gulpfile.mjs @@ -45,7 +45,11 @@ import { publishBeta, recompile, } from './scripts/gulpfiles/release_tasks.mjs'; -import {generators, test} from './scripts/gulpfiles/test_tasks.mjs'; +import { + generators, + interactiveMocha, + test, +} from './scripts/gulpfiles/test_tasks.mjs'; const clean = parallel(cleanBuildDir, cleanReleaseDir); @@ -80,6 +84,7 @@ export { clean, test, generators as testGenerators, + interactiveMocha, buildAdvancedCompilationTest, createRC as gitCreateRC, docs, diff --git a/package-lock.json b/package-lock.json index 345e4271927..61111110180 100644 --- a/package-lock.json +++ b/package-lock.json @@ -51,6 +51,7 @@ "patch-package": "^8.0.0", "prettier": "^3.3.3", "prettier-plugin-organize-imports": "^4.0.0", + "puppeteer-core": "^24.17.0", "readline-sync": "^1.4.10", "rimraf": "^5.0.0", "typescript": "^5.3.3", @@ -1282,18 +1283,18 @@ } }, "node_modules/@puppeteer/browsers": { - "version": "2.10.4", - "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.10.4.tgz", - "integrity": "sha512-9DxbZx+XGMNdjBynIs4BRSz+M3iRDeB7qRcAr6UORFLphCIM2x3DXgOucvADiifcqCE4XePFUKcnaAMyGbrDlQ==", + "version": "2.10.7", + "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.10.7.tgz", + "integrity": "sha512-wHWLkQWBjHtajZeqCB74nsa/X70KheyOhySYBRmVQDJiNj0zjZR/naPCvdWjMhcG1LmjaMV/9WtTo5mpe8qWLw==", "dev": true, "license": "Apache-2.0", "dependencies": { - "debug": "^4.4.0", + "debug": "^4.4.1", "extract-zip": "^2.0.1", "progress": "^2.0.3", "proxy-agent": "^6.5.0", - "semver": "^7.7.1", - "tar-fs": "^3.0.8", + "semver": "^7.7.2", + "tar-fs": "^3.1.0", "yargs": "^17.7.2" }, "bin": { @@ -2960,6 +2961,20 @@ "fsevents": "~2.3.2" } }, + "node_modules/chromium-bidi": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-8.0.0.tgz", + "integrity": "sha512-d1VmE0FD7lxZQHzcDUCKZSNRtRwISXDsdg4HjdTR5+Ll5nQ/vzU12JeNmupD6VWffrPSlrnGhEWlLESKH3VO+g==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "mitt": "^3.0.1", + "zod": "^3.24.1" + }, + "peerDependencies": { + "devtools-protocol": "*" + } + }, "node_modules/ci-info": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", @@ -3612,6 +3627,13 @@ "node": ">=0.10.0" } }, + "node_modules/devtools-protocol": { + "version": "0.0.1475386", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1475386.tgz", + "integrity": "sha512-RQ809ykTfJ+dgj9bftdeL2vRVxASAuGU+I9LEx9Ij5TXU5HrgAQVmzi72VA+mkzscE12uzlRv5/tWWv9R9J1SA==", + "dev": true, + "license": "BSD-3-Clause" + }, "node_modules/diff": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", @@ -6895,6 +6917,13 @@ "node": ">=16 || 14 >=14.17" } }, + "node_modules/mitt": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz", + "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==", + "dev": true, + "license": "MIT" + }, "node_modules/mkdirp": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", @@ -7925,6 +7954,24 @@ "node": ">=6" } }, + "node_modules/puppeteer-core": { + "version": "24.17.0", + "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-24.17.0.tgz", + "integrity": "sha512-RYOBKFiF+3RdwIZTEacqNpD567gaFcBAOKTT7742FdB1icXudrPI7BlZbYTYWK2wgGQUXt9Zi1Yn+D5PmCs4CA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@puppeteer/browsers": "2.10.7", + "chromium-bidi": "8.0.0", + "debug": "^4.4.1", + "devtools-protocol": "0.0.1475386", + "typed-query-selector": "^2.12.0", + "ws": "^8.18.3" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/qs": { "version": "6.14.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", @@ -8993,9 +9040,9 @@ } }, "node_modules/tar-fs": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.9.tgz", - "integrity": "sha512-XF4w9Xp+ZQgifKakjZYmFdkLoSWd34VGKcsTCwlNWM7QG3ZbaxnTsaBwnjFZqHRf/rROxaR8rXnbtwdvaDI+lA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.1.0.tgz", + "integrity": "sha512-5Mty5y/sOF1YWj1J6GiBodjlDc05CUR8PKXrsnFAiSG0xA+GHeWLovaZPYUDXkH/1iKRf2+M5+OrRgzC7O9b7w==", "dev": true, "license": "MIT", "dependencies": { @@ -9212,6 +9259,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/typed-query-selector": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/typed-query-selector/-/typed-query-selector-2.12.0.tgz", + "integrity": "sha512-SbklCd1F0EiZOyPiW192rrHZzZ5sBijB6xM+cpmrwDqObvdtunOHHIk9fCGsoK5JVIYXoyEp4iEdE3upFH3PAg==", + "dev": true, + "license": "MIT" + }, "node_modules/typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", @@ -9773,9 +9827,10 @@ "dev": true }, "node_modules/ws": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", - "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", + "version": "8.18.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", + "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", + "license": "MIT", "engines": { "node": ">=10.0.0" }, @@ -10029,6 +10084,16 @@ "dependencies": { "safe-buffer": "~5.2.0" } + }, + "node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } } } } diff --git a/package.json b/package.json index 29865b98659..3f45191f3ee 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "test": "gulp test", "test:browser": "cd tests/browser && npx mocha", "test:generators": "gulp testGenerators", - "test:mocha:interactive": "npm run build && concurrently -n tsc,server \"tsc --watch --preserveWatchOutput --outDir \"build/src\" --declarationDir \"build/declarations\"\" \"http-server ./ -o /tests/mocha/index.html -c-1\"", + "test:mocha:interactive": "npm run build && concurrently -n tsc,server \"tsc --watch --preserveWatchOutput --outDir \"build/src\" --declarationDir \"build/declarations\"\" \"gulp interactiveMocha\"", "test:compile:advanced": "gulp buildAdvancedCompilationTest --debug", "updateGithubPages": "npm ci && gulp gitUpdateGithubPages" }, @@ -138,6 +138,7 @@ "patch-package": "^8.0.0", "prettier": "^3.3.3", "prettier-plugin-organize-imports": "^4.0.0", + "puppeteer-core": "^24.17.0", "readline-sync": "^1.4.10", "rimraf": "^5.0.0", "typescript": "^5.3.3", diff --git a/scripts/gulpfiles/test_tasks.mjs b/scripts/gulpfiles/test_tasks.mjs index d4b73cdb3c1..37f9884440d 100644 --- a/scripts/gulpfiles/test_tasks.mjs +++ b/scripts/gulpfiles/test_tasks.mjs @@ -257,9 +257,9 @@ async function metadata() { * Run Mocha tests inside a browser. * @return {Promise} Asynchronous result. */ -async function mocha() { +async function mocha(exitOnCompletion = true) { return runTestTask('mocha', async () => { - const result = await runMochaTestsInBrowser().catch(e => { + const result = await runMochaTestsInBrowser(exitOnCompletion).catch(e => { throw e; }); if (result) { @@ -269,6 +269,14 @@ async function mocha() { }); } +/** + * Run Mocha tests inside a browser and keep the browser open upon completion. + * @return {Promise} Asynchronous result. + */ +export async function interactiveMocha() { + return mocha(false); +} + /** * Helper method for comparison file. * @param {string} file1 First target file. diff --git a/tests/mocha/webdriver.js b/tests/mocha/webdriver.js index 207917c5e6b..06e7a3e6585 100644 --- a/tests/mocha/webdriver.js +++ b/tests/mocha/webdriver.js @@ -15,9 +15,12 @@ const {posixPath} = require('../../scripts/helpers'); * Runs the Mocha tests in this directory in Chrome. It uses webdriverio to * launch Chrome and load index.html. Outputs a summary of the test results * to the console. + * + * @param {boolean} exitOnCompletetion True if the browser should automatically + * quit after tests have finished running. * @return {number} 0 on success, 1 on failure. */ -async function runMochaTestsInBrowser() { +async function runMochaTestsInBrowser(exitOnCompletion = true) { const options = { capabilities: { browserName: 'chrome', @@ -45,6 +48,17 @@ async function runMochaTestsInBrowser() { console.log('Loading URL: ' + url); await browser.url(url); + // Toggle the devtools setting to emulate focus, so that the window will + // always act as if it has focus regardless of the state of the window manager + // or operating system. This improves the reliability of FocusManager-related + // tests. + const puppeteer = await browser.getPuppeteer(); + await browser.call(async () => { + const page = (await puppeteer.pages())[0]; + const session = await page.createCDPSession(); + await session.send('Emulation.setFocusEmulationEnabled', { enabled: true }); + }); + await browser.waitUntil(async() => { const elem = await browser.$('#failureCount'); const text = await elem.getAttribute('tests_failed'); @@ -74,7 +88,7 @@ async function runMochaTestsInBrowser() { if (parseInt(numOfFailure) !== 0) { return 1; } - await browser.deleteSession(); + if (exitOnCompletion) await browser.deleteSession(); return 0; } From fd0aaedb10d77e672e2692ee96487bf304923d69 Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Thu, 28 Aug 2025 10:06:52 -0700 Subject: [PATCH 16/29] fix: Fix bug that could cause errant line when rendering. (#9333) --- core/renderers/common/drawer.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/renderers/common/drawer.ts b/core/renderers/common/drawer.ts index 7046406adc7..c474bc8c339 100644 --- a/core/renderers/common/drawer.ts +++ b/core/renderers/common/drawer.ts @@ -122,9 +122,12 @@ export class Drawer { } else if (Types.isSpacer(elem)) { this.outlinePath_ += svgPaths.lineOnAxis('h', elem.width); } + // No branch for a square corner, because it's a no-op. } - // No branch for a square corner, because it's a no-op. - this.outlinePath_ += svgPaths.lineOnAxis('v', topRow.height); + this.outlinePath_ += svgPaths.lineOnAxis( + 'v', + topRow.height - topRow.ascenderHeight, + ); } /** From 47307a9e5358de8c48e315218ea9efb3041fa8ac Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Thu, 28 Aug 2025 11:28:40 -0700 Subject: [PATCH 17/29] refactor: Make focusable elements responsible for scrolling themselves into bounds. (#9288) * refactor: Make focusable elements responsible for scrolling themselves into bounds. * chore: Add tests for scrolling focused elements into view. * fix: Removed inadvertent `.only`. * fix: Scroll parent block of connections into bounds on focus. --- core/block_svg.ts | 3 + core/bubbles/bubble.ts | 4 + core/comments/comment_bar_button.ts | 8 +- core/comments/comment_editor.ts | 13 +- core/comments/rendered_workspace_comment.ts | 1 + core/field.ts | 7 +- core/flyout_button.ts | 6 +- core/icons/icon.ts | 12 +- core/keyboard_nav/line_cursor.ts | 30 +-- core/rendered_connection.ts | 7 +- tests/browser/test/basic_playground_test.mjs | 221 +++++++++++++++++++ 11 files changed, 276 insertions(+), 36 deletions(-) diff --git a/core/block_svg.ts b/core/block_svg.ts index c6065282a5c..b3fdeb2d6b6 100644 --- a/core/block_svg.ts +++ b/core/block_svg.ts @@ -1844,6 +1844,9 @@ export class BlockSvg /** See IFocusableNode.onNodeFocus. */ onNodeFocus(): void { this.select(); + this.workspace.scrollBoundsIntoView( + this.getBoundingRectangleWithoutChildren(), + ); } /** See IFocusableNode.onNodeBlur. */ diff --git a/core/bubbles/bubble.ts b/core/bubbles/bubble.ts index c42e602544e..742d300adf1 100644 --- a/core/bubbles/bubble.ts +++ b/core/bubbles/bubble.ts @@ -707,6 +707,10 @@ export abstract class Bubble implements IBubble, ISelectable, IFocusableNode { onNodeFocus(): void { this.select(); this.bringToFront(); + const xy = this.getRelativeToSurfaceXY(); + const size = this.getSize(); + const bounds = new Rect(xy.y, xy.y + size.height, xy.x, xy.x + size.width); + this.workspace.scrollBoundsIntoView(bounds); } /** See IFocusableNode.onNodeBlur. */ diff --git a/core/comments/comment_bar_button.ts b/core/comments/comment_bar_button.ts index 24a084ad26e..be130b0e335 100644 --- a/core/comments/comment_bar_button.ts +++ b/core/comments/comment_bar_button.ts @@ -87,7 +87,13 @@ export abstract class CommentBarButton implements IFocusableNode { } /** Called when this button's focusable DOM element gains focus. */ - onNodeFocus() {} + onNodeFocus() { + const commentView = this.getCommentView(); + const xy = commentView.getRelativeToSurfaceXY(); + const size = commentView.getSize(); + const bounds = new Rect(xy.y, xy.y + size.height, xy.x, xy.x + size.width); + commentView.workspace.scrollBoundsIntoView(bounds); + } /** Called when this button's focusable DOM element loses focus. */ onNodeBlur() {} diff --git a/core/comments/comment_editor.ts b/core/comments/comment_editor.ts index ac1559c4b3d..b4c741ba1ad 100644 --- a/core/comments/comment_editor.ts +++ b/core/comments/comment_editor.ts @@ -10,8 +10,10 @@ import {IFocusableNode} from '../interfaces/i_focusable_node.js'; import {IFocusableTree} from '../interfaces/i_focusable_tree.js'; import * as touch from '../touch.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 svgMath from '../utils/svg_math.js'; import {WorkspaceSvg} from '../workspace_svg.js'; /** @@ -188,7 +190,16 @@ export class CommentEditor implements IFocusableNode { getFocusableTree(): IFocusableTree { return this.workspace; } - onNodeFocus(): void {} + onNodeFocus(): void { + const bbox = Rect.from(this.foreignObject.getBoundingClientRect()); + this.workspace.scrollBoundsIntoView( + Rect.createFromPoint( + svgMath.screenToWsCoordinates(this.workspace, bbox.getOrigin()), + bbox.getWidth(), + bbox.getHeight(), + ), + ); + } onNodeBlur(): void {} canBeFocused(): boolean { if (this.id) return true; diff --git a/core/comments/rendered_workspace_comment.ts b/core/comments/rendered_workspace_comment.ts index 49c75e60883..2903bff4bce 100644 --- a/core/comments/rendered_workspace_comment.ts +++ b/core/comments/rendered_workspace_comment.ts @@ -347,6 +347,7 @@ export class RenderedWorkspaceComment this.select(); // Ensure that the comment is always at the top when focused. this.workspace.getLayerManager()?.append(this, layers.BLOCK); + this.workspace.scrollBoundsIntoView(this.getBoundingRectangle()); } /** See IFocusableNode.onNodeBlur. */ diff --git a/core/field.ts b/core/field.ts index d993e197d23..e025efab709 100644 --- a/core/field.ts +++ b/core/field.ts @@ -1380,7 +1380,12 @@ export abstract class Field } /** See IFocusableNode.onNodeFocus. */ - onNodeFocus(): void {} + onNodeFocus(): void { + const block = this.getSourceBlock() as BlockSvg; + block.workspace.scrollBoundsIntoView( + block.getBoundingRectangleWithoutChildren(), + ); + } /** See IFocusableNode.onNodeBlur. */ onNodeBlur(): void {} diff --git a/core/flyout_button.ts b/core/flyout_button.ts index c9afb8b0159..5a066a23b11 100644 --- a/core/flyout_button.ts +++ b/core/flyout_button.ts @@ -398,7 +398,11 @@ export class FlyoutButton } /** See IFocusableNode.onNodeFocus. */ - onNodeFocus(): void {} + onNodeFocus(): void { + const xy = this.getPosition(); + const bounds = new Rect(xy.y, xy.y + this.height, xy.x, xy.x + this.width); + this.workspace.scrollBoundsIntoView(bounds); + } /** See IFocusableNode.onNodeBlur. */ onNodeBlur(): void {} diff --git a/core/icons/icon.ts b/core/icons/icon.ts index 8f8ff70fc32..f5f76603875 100644 --- a/core/icons/icon.ts +++ b/core/icons/icon.ts @@ -14,6 +14,7 @@ import * as tooltip from '../tooltip.js'; import {Coordinate} from '../utils/coordinate.js'; import * as dom from '../utils/dom.js'; import * as idGenerator from '../utils/idgenerator.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'; @@ -168,7 +169,16 @@ export abstract class Icon implements IIcon { } /** See IFocusableNode.onNodeFocus. */ - onNodeFocus(): void {} + onNodeFocus(): void { + const blockBounds = (this.sourceBlock as BlockSvg).getBoundingRectangle(); + const bounds = new Rect( + blockBounds.top + this.offsetInBlock.y, + blockBounds.top + this.offsetInBlock.y + this.getSize().height, + blockBounds.left + this.offsetInBlock.x, + blockBounds.left + this.offsetInBlock.x + this.getSize().width, + ); + (this.sourceBlock as BlockSvg).workspace.scrollBoundsIntoView(bounds); + } /** See IFocusableNode.onNodeBlur. */ onNodeBlur(): void {} diff --git a/core/keyboard_nav/line_cursor.ts b/core/keyboard_nav/line_cursor.ts index 13e5a729d0f..30770e47d2d 100644 --- a/core/keyboard_nav/line_cursor.ts +++ b/core/keyboard_nav/line_cursor.ts @@ -14,14 +14,11 @@ */ import {BlockSvg} from '../block_svg.js'; -import {CommentBarButton} from '../comments/comment_bar_button.js'; import {RenderedWorkspaceComment} from '../comments/rendered_workspace_comment.js'; -import {Field} from '../field.js'; import {getFocusManager} from '../focus_manager.js'; import type {IFocusableNode} from '../interfaces/i_focusable_node.js'; import * as registry from '../registry.js'; -import {Rect} from '../utils/rect.js'; -import {WorkspaceSvg} from '../workspace_svg.js'; +import type {WorkspaceSvg} from '../workspace_svg.js'; import {Marker} from './marker.js'; /** @@ -392,31 +389,6 @@ export class LineCursor extends Marker { */ setCurNode(newNode: IFocusableNode) { getFocusManager().focusNode(newNode); - - // Try to scroll cursor into view. - if (newNode instanceof BlockSvg) { - newNode.workspace.scrollBoundsIntoView( - newNode.getBoundingRectangleWithoutChildren(), - ); - } else if (newNode instanceof Field) { - const block = newNode.getSourceBlock() as BlockSvg; - block.workspace.scrollBoundsIntoView( - block.getBoundingRectangleWithoutChildren(), - ); - } else if (newNode instanceof RenderedWorkspaceComment) { - newNode.workspace.scrollBoundsIntoView(newNode.getBoundingRectangle()); - } else if (newNode instanceof CommentBarButton) { - const commentView = newNode.getCommentView(); - const xy = commentView.getRelativeToSurfaceXY(); - const size = commentView.getSize(); - const bounds = new Rect( - xy.y, - xy.y + size.height, - xy.x, - xy.x + size.width, - ); - commentView.workspace.scrollBoundsIntoView(bounds); - } } /** diff --git a/core/rendered_connection.ts b/core/rendered_connection.ts index 84905eeccc2..4a53048bc84 100644 --- a/core/rendered_connection.ts +++ b/core/rendered_connection.ts @@ -644,6 +644,9 @@ export class RenderedConnection /** See IFocusableNode.onNodeFocus. */ onNodeFocus(): void { this.highlight(); + this.getSourceBlock().workspace.scrollBoundsIntoView( + this.getSourceBlock().getBoundingRectangleWithoutChildren(), + ); } /** See IFocusableNode.onNodeBlur. */ @@ -656,12 +659,12 @@ export class RenderedConnection return true; } - private findHighlightSvg(): SVGElement | null { + private findHighlightSvg(): SVGPathElement | null { // This cast is valid as TypeScript's definition is wrong. See: // https://github.com/microsoft/TypeScript/issues/60996. return document.getElementById(this.id) as | unknown - | null as SVGElement | null; + | null as SVGPathElement | null; } } diff --git a/tests/browser/test/basic_playground_test.mjs b/tests/browser/test/basic_playground_test.mjs index c7c8a5a370c..72b3894a6a3 100644 --- a/tests/browser/test/basic_playground_test.mjs +++ b/tests/browser/test/basic_playground_test.mjs @@ -238,3 +238,224 @@ suite('Disabling', function () { }, ); }); + +suite('Focused nodes are scrolled into bounds', function () { + // Setting timeout to unlimited as the webdriver takes a longer time to run + // than most mocha tests. + this.timeout(0); + + // Setup Selenium for all of the tests + suiteSetup(async function () { + this.browser = await testSetup(testFileLocations.PLAYGROUND); + await this.browser.execute(() => { + window.focusScrollTest = async (testcase) => { + const workspace = Blockly.getMainWorkspace(); + const metrics = workspace.getMetricsManager(); + const initialViewport = metrics.getViewMetrics(true); + const elementBounds = await testcase(workspace); + await Blockly.renderManagement.finishQueuedRenders(); + const scrolledViewport = metrics.getViewMetrics(true); + const workspaceBounds = new Blockly.utils.Rect( + scrolledViewport.top, + scrolledViewport.top + scrolledViewport.height, + scrolledViewport.left, + scrolledViewport.left + scrolledViewport.width, + ); + return { + changed: + JSON.stringify(initialViewport) !== + JSON.stringify(scrolledViewport), + intersects: elementBounds.intersects(workspaceBounds), + contains: workspaceBounds.contains( + elementBounds.getOrigin().x, + elementBounds.getOrigin().y, + ), + elementBounds, + workspaceBounds, + }; + }; + }); + }); + + setup(async function () { + await this.browser.execute(() => { + Blockly.serialization.blocks.append( + { + 'type': 'text', + 'x': -500, + 'y': -500, + }, + Blockly.getMainWorkspace(), + ); + Blockly.serialization.blocks.append( + { + 'type': 'controls_if', + 'x': 500, + 'y': 500, + }, + Blockly.getMainWorkspace(), + ); + Blockly.getMainWorkspace().zoomCenter(1); + }); + }); + + test('Focused blocks scroll into bounds', async function () { + const result = await this.browser.execute(async () => { + return await window.focusScrollTest(async (workspace) => { + const block = workspace.getTopBlocks()[0]; + Blockly.getFocusManager().focusNode(block); + return block.getBoundingRectangleWithoutChildren(); + }); + }); + chai.assert.isTrue(result.intersects); + chai.assert.isTrue(result.contains); + chai.assert.isTrue(result.changed); + }); + + test('Focused bubbles scroll into bounds', async function () { + const result = await this.browser.execute(async () => { + return await window.focusScrollTest(async (workspace) => { + const block = workspace.getTopBlocks()[0]; + block.setCommentText('hello world'); + const icon = block.getIcon(Blockly.icons.IconType.COMMENT); + icon.setBubbleVisible(true); + await Blockly.renderManagement.finishQueuedRenders(); + icon.setBubbleLocation(new Blockly.utils.Coordinate(-510, -510)); + Blockly.getFocusManager().focusNode(icon.getBubble()); + const xy = icon.getBubble().getRelativeToSurfaceXY(); + const size = icon.getBubble().getSize(); + return new Blockly.utils.Rect( + xy.y, + xy.y + size.height, + xy.x, + xy.x + size.width, + ); + }); + }); + + chai.assert.isTrue(result.intersects); + chai.assert.isTrue(result.contains); + chai.assert.isTrue(result.changed); + }); + + test('Comment bar buttons scroll into bounds', async function () { + const result = await this.browser.execute(async () => { + return await window.focusScrollTest(async (workspace) => { + const comment = new Blockly.comments.RenderedWorkspaceComment( + workspace, + ); + comment.moveTo(new Blockly.utils.Coordinate(-300, 500)); + const commentBarButton = comment.view.getCommentBarButtons()[0]; + Blockly.getFocusManager().focusNode(commentBarButton); + const xy = comment.view.getRelativeToSurfaceXY(); + const size = comment.view.getSize(); + // Comment bar buttons scroll their parent comment view into view. + return new Blockly.utils.Rect( + xy.y, + xy.y + size.height, + xy.x, + xy.x + size.width, + ); + }); + }); + + chai.assert.isTrue(result.intersects); + chai.assert.isTrue(result.contains); + chai.assert.isTrue(result.changed); + }); + + test('Comment editors scroll into bounds', async function () { + const result = await this.browser.execute(async () => { + return await window.focusScrollTest(async (workspace) => { + const comment = new Blockly.comments.RenderedWorkspaceComment( + workspace, + ); + comment.moveTo(new Blockly.utils.Coordinate(-300, 500)); + const commentEditor = comment.view.getEditorFocusableNode(); + Blockly.getFocusManager().focusNode(commentEditor); + // Comment editor bounds can't be calculated externally since they + // depend on private properties, but the comment view is a reasonable + // proxy. + const xy = comment.view.getRelativeToSurfaceXY(); + const size = comment.view.getSize(); + return new Blockly.utils.Rect( + xy.y, + xy.y + size.height, + xy.x, + xy.x + size.width, + ); + }); + }); + + chai.assert.isTrue(result.intersects); + chai.assert.isTrue(result.contains); + chai.assert.isTrue(result.changed); + }); + + test('Workspace comments scroll into bounds', async function () { + const result = await this.browser.execute(async () => { + return await window.focusScrollTest(async (workspace) => { + const comment = new Blockly.comments.RenderedWorkspaceComment( + workspace, + ); + comment.moveTo(new Blockly.utils.Coordinate(-500, 500)); + Blockly.getFocusManager().focusNode(comment); + return comment.getBoundingRectangle(); + }); + }); + + chai.assert.isTrue(result.intersects); + chai.assert.isTrue(result.contains); + chai.assert.isTrue(result.changed); + }); + + test('Icons scroll into bounds', async function () { + const result = await this.browser.execute(async () => { + return await window.focusScrollTest(async (workspace) => { + const block = workspace.getTopBlocks()[0]; + block.setWarningText('this is bad'); + const icon = block.getIcon(Blockly.icons.IconType.WARNING); + Blockly.getFocusManager().focusNode(icon); + // Icon bounds can't be calculated externally since they depend on + // protected properties, but the parent block is a reasonable proxy. + return block.getBoundingRectangleWithoutChildren(); + }); + }); + + chai.assert.isTrue(result.intersects); + chai.assert.isTrue(result.contains); + chai.assert.isTrue(result.changed); + }); + + test('Fields scroll into bounds', async function () { + const result = await this.browser.execute(async () => { + return await window.focusScrollTest(async (workspace) => { + const block = workspace.getTopBlocks()[0]; + const field = block.getField('TEXT'); + Blockly.getFocusManager().focusNode(field); + // Fields scroll their source block into view. + return block.getBoundingRectangleWithoutChildren(); + }); + }); + + chai.assert.isTrue(result.intersects); + chai.assert.isTrue(result.contains); + chai.assert.isTrue(result.changed); + }); + + test('Connections scroll into bounds', async function () { + const result = await this.browser.execute(async () => { + return await window.focusScrollTest(async (workspace) => { + const block = workspace.getBlocksByType('controls_if')[0]; + Blockly.getFocusManager().focusNode(block.nextConnection); + // Connection bounds can't be calculated externally since they depend on + // protected properties, but the parent block is a reasonable proxy. + return block.getBoundingRectangleWithoutChildren(); + }); + }); + + chai.assert.isTrue(result.intersects); + chai.assert.isTrue(result.contains); + chai.assert.isTrue(result.changed); + }); +}); From 9b60088d4bcd5048aacfefa46ccabef99bf5d77b Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Tue, 2 Sep 2025 12:39:16 -0700 Subject: [PATCH 18/29] fix: Fix bug that could caused variable map to be left in an inconsistent state. (#9339) --- core/variable_map.ts | 6 +++++- tests/mocha/variable_map_test.js | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/core/variable_map.ts b/core/variable_map.ts index ba36dcea600..3a6cf402681 100644 --- a/core/variable_map.ts +++ b/core/variable_map.ts @@ -112,7 +112,11 @@ export class VariableMap const oldType = variable.getType(); if (oldType === newType) return variable; - this.variableMap.get(variable.getType())?.delete(variable.getId()); + const oldTypeVariables = this.variableMap.get(oldType); + oldTypeVariables?.delete(variable.getId()); + if (oldTypeVariables?.size === 0) { + this.variableMap.delete(oldType); + } variable.setType(newType); const newTypeVariables = this.variableMap.get(newType) ?? diff --git a/tests/mocha/variable_map_test.js b/tests/mocha/variable_map_test.js index 76dffbe9dc7..b0ceec28e4c 100644 --- a/tests/mocha/variable_map_test.js +++ b/tests/mocha/variable_map_test.js @@ -258,6 +258,13 @@ suite('Variable Map', function () { assert.deepEqual(newTypeVariables, [variable]); assert.equal(variable.getType(), ''); }); + + test('removes the type from the map when the last instance is changed', function () { + const var1 = this.variableMap.createVariable('name1', 'type1'); + const var2 = this.variableMap.createVariable('name2', 'type2'); + this.variableMap.changeVariableType(var1, 'type2'); + assert.deepEqual(this.variableMap.getTypes(), ['type2']); + }); }, ); From 10e6df32ed32108d5401f58b79a47bda251e1cd8 Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Fri, 5 Sep 2025 11:07:35 -0700 Subject: [PATCH 19/29] fix: Allow cross origin requests for Blockly assets. (#9342) --- appengine/app.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/appengine/app.yaml b/appengine/app.yaml index 9c93fb6873d..563af8b24d0 100644 --- a/appengine/app.yaml +++ b/appengine/app.yaml @@ -70,6 +70,8 @@ handlers: # Blockly files. - url: /static static_dir: static + http_headers: + Access-Control-Allow-Origin: "*" secure: always # Storage API. From 0a4bb5c33fc516bf8b33714ed72877f3cfebf61b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Sep 2025 09:09:07 +0000 Subject: [PATCH 20/29] chore(deps): bump prettier-plugin-organize-imports from 4.1.0 to 4.2.0 Bumps [prettier-plugin-organize-imports](https://github.com/simonhaenisch/prettier-plugin-organize-imports) from 4.1.0 to 4.2.0. - [Release notes](https://github.com/simonhaenisch/prettier-plugin-organize-imports/releases) - [Changelog](https://github.com/simonhaenisch/prettier-plugin-organize-imports/blob/master/changelog.md) - [Commits](https://github.com/simonhaenisch/prettier-plugin-organize-imports/compare/v4.1.0...v4.2.0) --- updated-dependencies: - dependency-name: prettier-plugin-organize-imports dependency-version: 4.2.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index afd057ce613..8b80ff60ba1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7858,14 +7858,15 @@ } }, "node_modules/prettier-plugin-organize-imports": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-4.1.0.tgz", - "integrity": "sha512-5aWRdCgv645xaa58X8lOxzZoiHAldAPChljr/MT0crXVOWTZ+Svl4hIWlz+niYSlO6ikE5UXkN1JrRvIP2ut0A==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-4.2.0.tgz", + "integrity": "sha512-Zdy27UhlmyvATZi67BTnLcKTo8fm6Oik59Sz6H64PgZJVs6NJpPD1mT240mmJn62c98/QaL+r3kx9Q3gRpDajg==", "dev": true, + "license": "MIT", "peerDependencies": { "prettier": ">=2.0", "typescript": ">=2.9", - "vue-tsc": "^2.1.0" + "vue-tsc": "^2.1.0 || 3" }, "peerDependenciesMeta": { "vue-tsc": { From 2c46686d7d8149c034f75f242d5b8c2e009725db Mon Sep 17 00:00:00 2001 From: Maribeth Moffatt Date: Tue, 9 Sep 2025 09:19:17 -0700 Subject: [PATCH 21/29] fix: minor fixes to translation files (#9350) --- msg/json/constants.json | 15 ++++++++------- msg/json/en.json | 2 +- msg/json/synonyms.json | 4 ++-- msg/messages.js | 4 ++-- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/msg/json/constants.json b/msg/json/constants.json index ede1c1b75c2..2677e406f74 100644 --- a/msg/json/constants.json +++ b/msg/json/constants.json @@ -1,11 +1,12 @@ { - "MATH_HUE": "230", - "LOOPS_HUE": "120", + "#": "Automatically generated, do not edit this file!", + "COLOUR_HUE": "20", "LISTS_HUE": "260", "LOGIC_HUE": "210", - "VARIABLES_HUE": "330", - "TEXTS_HUE": "160", + "LOOPS_HUE": "120", + "MATH_HUE": "230", "PROCEDURES_HUE": "290", - "COLOUR_HUE": "20", - "VARIABLES_DYNAMIC_HUE": "310" -} + "TEXTS_HUE": "160", + "VARIABLES_DYNAMIC_HUE": "310", + "VARIABLES_HUE": "330" +} \ No newline at end of file diff --git a/msg/json/en.json b/msg/json/en.json index 5494d7fb09f..ec5862ae465 100644 --- a/msg/json/en.json +++ b/msg/json/en.json @@ -1,7 +1,7 @@ { "@metadata": { "author": "Ellen Spertus ", - "lastupdated": "2025-06-17 15:36:41.845826", + "lastupdated": "2025-09-08 16:26:57.642330", "locale": "en", "messagedocumentation" : "qqq" }, diff --git a/msg/json/synonyms.json b/msg/json/synonyms.json index 1af8184700d..9fc089ebea7 100644 --- a/msg/json/synonyms.json +++ b/msg/json/synonyms.json @@ -1,4 +1,5 @@ { + "#": "Automatically generated, do not edit this file!", "CONTROLS_FOREACH_INPUT_DO": "CONTROLS_REPEAT_INPUT_DO", "CONTROLS_FOR_INPUT_DO": "CONTROLS_REPEAT_INPUT_DO", "CONTROLS_IF_ELSEIF_TITLE_ELSEIF": "CONTROLS_IF_MSG_ELSEIF", @@ -7,7 +8,6 @@ "CONTROLS_IF_MSG_THEN": "CONTROLS_REPEAT_INPUT_DO", "CONTROLS_WHILEUNTIL_INPUT_DO": "CONTROLS_REPEAT_INPUT_DO", "LISTS_CREATE_WITH_ITEM_TITLE": "VARIABLES_DEFAULT_NAME", - "LISTS_GET_INDEX_HELPURL": "LISTS_INDEX_OF_HELPURL", "LISTS_GET_INDEX_INPUT_IN_LIST": "LISTS_INLIST", "LISTS_GET_SUBLIST_INPUT_IN_LIST": "LISTS_INLIST", "LISTS_INDEX_OF_INPUT_IN_LIST": "LISTS_INLIST", @@ -19,4 +19,4 @@ "PROCEDURES_DEFRETURN_TITLE": "PROCEDURES_DEFNORETURN_TITLE", "TEXT_APPEND_VARIABLE": "VARIABLES_DEFAULT_NAME", "TEXT_CREATE_JOIN_ITEM_TITLE_ITEM": "VARIABLES_DEFAULT_NAME" -} +} \ No newline at end of file diff --git a/msg/messages.js b/msg/messages.js index b7611b4849b..1095ae05776 100644 --- a/msg/messages.js +++ b/msg/messages.js @@ -85,10 +85,10 @@ Blockly.Msg.REMOVE_COMMENT = 'Remove Comment'; /// context menu - Make a copy of the selected workspace comment.\n{{Identical|Duplicate}} Blockly.Msg.DUPLICATE_COMMENT = 'Duplicate Comment'; /** @type {string} */ -/// context menu - Change from 'external' to 'inline' mode for displaying blocks used as inputs to the selected block. See [[Translating:Blockly#context_menus]]. +/// context menu - Change from 'external' to 'inline' mode for displaying blocks used as inputs to the selected block. See [[Translating:Blockly#context_menus]].\n\nThe opposite of {{msg-blockly|INLINE INPUTS}}. Blockly.Msg.EXTERNAL_INPUTS = 'External Inputs'; /** @type {string} */ -/// context menu - Change from 'internal' to 'external' mode for displaying blocks used as inputs to the selected block. See [[Translating:Blockly#context_menus]]. +/// context menu - Change from 'internal' to 'external' mode for displaying blocks used as inputs to the selected block. See [[Translating:Blockly#context_menus]].\n\nThe opposite of {{msg-blockly|EXTERNAL INPUTS}}. Blockly.Msg.INLINE_INPUTS = 'Inline Inputs'; /** @type {string} */ /// context menu - Permanently delete the selected block. From 2649f5171debef03eb88bdc84ab7d0965f71eb96 Mon Sep 17 00:00:00 2001 From: Maribeth Moffatt Date: Fri, 12 Sep 2025 10:59:37 -0700 Subject: [PATCH 22/29] chore: add keyboard nav to advanced playground (#9359) --- package-lock.json | 10 ++++++++ package.json | 1 + tests/playgrounds/advanced_playground.html | 30 ++++++++++++++++++++++ 3 files changed, 41 insertions(+) diff --git a/package-lock.json b/package-lock.json index 8b80ff60ba1..8dc8efdbcba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "devDependencies": { "@blockly/block-test": "^7.0.2", "@blockly/dev-tools": "^9.0.2", + "@blockly/keyboard-navigation": "^3.0.1", "@blockly/theme-modern": "^7.0.1", "@hyperjump/browser": "^1.1.4", "@hyperjump/json-schema": "^1.5.0", @@ -199,6 +200,15 @@ "node": "*" } }, + "node_modules/@blockly/keyboard-navigation": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@blockly/keyboard-navigation/-/keyboard-navigation-3.0.1.tgz", + "integrity": "sha512-qSOPqsqRgkSLEoUeEZc81PWe558pXqY0e+4jkRODoAD+I1hMpCoD+6ivveRp7Jpb8WE1lj2PrAFOVuIVpphjHA==", + "dev": true, + "peerDependencies": { + "blockly": "^12.3.0" + } + }, "node_modules/@blockly/theme-dark": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/@blockly/theme-dark/-/theme-dark-8.0.1.tgz", diff --git a/package.json b/package.json index 7b639a872ea..b2892977c91 100644 --- a/package.json +++ b/package.json @@ -102,6 +102,7 @@ "devDependencies": { "@blockly/block-test": "^7.0.2", "@blockly/dev-tools": "^9.0.2", + "@blockly/keyboard-navigation": "^3.0.1", "@blockly/theme-modern": "^7.0.1", "@hyperjump/browser": "^1.1.4", "@hyperjump/json-schema": "^1.5.0", diff --git a/tests/playgrounds/advanced_playground.html b/tests/playgrounds/advanced_playground.html index 1fcbbd812a9..5c00de6ee99 100644 --- a/tests/playgrounds/advanced_playground.html +++ b/tests/playgrounds/advanced_playground.html @@ -18,6 +18,11 @@ await loadScript( '../../node_modules/@blockly/theme-modern/dist/index.js', ); + await loadScript( + '../../node_modules/@blockly/keyboard-navigation/dist/index.js', + ); + + let kbNavigation; function start() { setBackgroundColour(); @@ -47,6 +52,28 @@ // Refresh theme. ws.setTheme(ws.getTheme()); }); + + // Keyboard navigation options. + const kbOptions = { + 'Enable keyboard navigation': false, + }; + gui.remember(kbOptions); + gui.add(kbOptions, 'Enable keyboard navigation').onChange((enabled) => { + setupKeyboardNav(enabled, playground); + }); + + // Set up keyboard navigation on page load + setupKeyboardNav(kbOptions['Enable keyboard navigation'], playground); + } + + function setupKeyboardNav(enabled, playground) { + if (enabled) { + kbNavigation = new KeyboardNavigation(playground.getWorkspace()); + } else { + if (kbNavigation) { + kbNavigation.dispose(); + } + } } function initPlayground() { @@ -101,6 +128,8 @@ }; Blockly.ContextMenuItems.registerCommentOptions(); + KeyboardNavigation.registerKeyboardNavigationStyles(); + // TODO: register the navigation-deferring toolbox. createPlayground( document.getElementById('root'), @@ -153,6 +182,7 @@ +
From e0556818b9fb15c233b32170a6d6c885f88737db Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Sep 2025 20:23:54 +0100 Subject: [PATCH 23/29] chore(deps): bump concurrently from 9.2.0 to 9.2.1 (#9328) Bumps [concurrently](https://github.com/open-cli-tools/concurrently) from 9.2.0 to 9.2.1. - [Release notes](https://github.com/open-cli-tools/concurrently/releases) - [Commits](https://github.com/open-cli-tools/concurrently/compare/v9.2.0...v9.2.1) --- updated-dependencies: - dependency-name: concurrently dependency-version: 9.2.1 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 | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8dc8efdbcba..bce8773951d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3233,19 +3233,18 @@ } }, "node_modules/concurrently": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-9.2.0.tgz", - "integrity": "sha512-IsB/fiXTupmagMW4MNp2lx2cdSN2FfZq78vF90LBB+zZHArbIQZjQtzXCiXnvTxCZSvXanTqFLWBjw2UkLx1SQ==", + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-9.2.1.tgz", + "integrity": "sha512-fsfrO0MxV64Znoy8/l1vVIjjHa29SZyyqPgQBwhiDcaW8wJc2W3XWVOGx4M3oJBnv/zdUZIIp1gDeS98GzP8Ng==", "dev": true, "license": "MIT", "dependencies": { - "chalk": "^4.1.2", - "lodash": "^4.17.21", - "rxjs": "^7.8.1", - "shell-quote": "^1.8.1", - "supports-color": "^8.1.1", - "tree-kill": "^1.2.2", - "yargs": "^17.7.2" + "chalk": "4.1.2", + "rxjs": "7.8.2", + "shell-quote": "1.8.3", + "supports-color": "8.1.1", + "tree-kill": "1.2.2", + "yargs": "17.7.2" }, "bin": { "conc": "dist/bin/concurrently.js", @@ -8417,19 +8416,21 @@ } }, "node_modules/rxjs": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", - "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", + "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", "dev": true, + "license": "Apache-2.0", "dependencies": { "tslib": "^2.1.0" } }, "node_modules/rxjs/node_modules/tslib": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.3.tgz", - "integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==", - "dev": true + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD" }, "node_modules/safaridriver": { "version": "1.0.0", @@ -8548,10 +8549,14 @@ } }, "node_modules/shell-quote": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", - "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.3.tgz", + "integrity": "sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==", "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } From 644c59f07a2477c87812eba94c29c876b3f3a51e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Sep 2025 15:15:55 -0700 Subject: [PATCH 24/29] chore(deps): bump mocha from 11.7.1 to 11.7.2 (#9344) Bumps [mocha](https://github.com/mochajs/mocha) from 11.7.1 to 11.7.2. - [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/v11.7.1...v11.7.2) --- updated-dependencies: - dependency-name: mocha dependency-version: 11.7.2 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, 4 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index bce8773951d..b682b77e202 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6946,10 +6946,11 @@ } }, "node_modules/mocha": { - "version": "11.7.1", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.1.tgz", - "integrity": "sha512-5EK+Cty6KheMS/YLPPMJC64g5V61gIR25KsRItHw6x4hEKT6Njp1n9LOlH4gpevuwMVS66SXaBBpg+RWZkza4A==", + "version": "11.7.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.2.tgz", + "integrity": "sha512-lkqVJPmqqG/w5jmmFtiRvtA2jkDyNVUcefFJKb2uyX4dekk8Okgqop3cgbFiaIvj8uCRJVTP5x9dfxGyXm2jvQ==", "dev": true, + "license": "MIT", "dependencies": { "browser-stdout": "^1.3.1", "chokidar": "^4.0.1", From 7274f4babb5c8ede07d9d8a5abfafb78af48ac15 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Sep 2025 15:17:32 -0700 Subject: [PATCH 25/29] chore(deps): bump puppeteer-core from 24.17.0 to 24.20.0 (#9365) Bumps [puppeteer-core](https://github.com/puppeteer/puppeteer) from 24.17.0 to 24.20.0. - [Release notes](https://github.com/puppeteer/puppeteer/releases) - [Changelog](https://github.com/puppeteer/puppeteer/blob/main/CHANGELOG.md) - [Commits](https://github.com/puppeteer/puppeteer/compare/puppeteer-core-v24.17.0...puppeteer-core-v24.20.0) --- updated-dependencies: - dependency-name: puppeteer-core dependency-version: 24.20.0 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 | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index b682b77e202..eb079027594 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1293,9 +1293,9 @@ } }, "node_modules/@puppeteer/browsers": { - "version": "2.10.7", - "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.10.7.tgz", - "integrity": "sha512-wHWLkQWBjHtajZeqCB74nsa/X70KheyOhySYBRmVQDJiNj0zjZR/naPCvdWjMhcG1LmjaMV/9WtTo5mpe8qWLw==", + "version": "2.10.9", + "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.10.9.tgz", + "integrity": "sha512-kUGHwABarVhvMP+zhW5zvDA7LmGcd4TwrTEBwcTQic5EebUqaK5NjC0UXLJepIFVGsr2N/Z8NJQz2JYGo1ZwxA==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -3637,9 +3637,9 @@ } }, "node_modules/devtools-protocol": { - "version": "0.0.1475386", - "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1475386.tgz", - "integrity": "sha512-RQ809ykTfJ+dgj9bftdeL2vRVxASAuGU+I9LEx9Ij5TXU5HrgAQVmzi72VA+mkzscE12uzlRv5/tWWv9R9J1SA==", + "version": "0.0.1495869", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1495869.tgz", + "integrity": "sha512-i+bkd9UYFis40RcnkW7XrOprCujXRAHg62IVh/Ah3G8MmNXpCGt1m0dTFhSdx/AVs8XEMbdOGRwdkR1Bcta8AA==", "dev": true, "license": "BSD-3-Clause" }, @@ -7966,17 +7966,18 @@ } }, "node_modules/puppeteer-core": { - "version": "24.17.0", - "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-24.17.0.tgz", - "integrity": "sha512-RYOBKFiF+3RdwIZTEacqNpD567gaFcBAOKTT7742FdB1icXudrPI7BlZbYTYWK2wgGQUXt9Zi1Yn+D5PmCs4CA==", + "version": "24.20.0", + "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-24.20.0.tgz", + "integrity": "sha512-n0y/f8EYyZt4yEJkjP3Vrqf9A4qa3uYpKYdsiedIY4bxIfTw1aAJSpSVPmWBPlr1LO4cNq2hGNIBWKPhvBF68w==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@puppeteer/browsers": "2.10.7", + "@puppeteer/browsers": "2.10.9", "chromium-bidi": "8.0.0", "debug": "^4.4.1", - "devtools-protocol": "0.0.1475386", + "devtools-protocol": "0.0.1495869", "typed-query-selector": "^2.12.0", + "webdriver-bidi-protocol": "0.2.8", "ws": "^8.18.3" }, "engines": { @@ -9681,6 +9682,13 @@ "node": ">=18.20.0" } }, + "node_modules/webdriver-bidi-protocol": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/webdriver-bidi-protocol/-/webdriver-bidi-protocol-0.2.8.tgz", + "integrity": "sha512-KPvtVAIX8VHjLZH1KHT5GXoOaPeb0Ju+JlAcdshw6Z/gsmRtLoxt0Hw99PgJwZta7zUQaAUIHHWDRkzrPHsQTQ==", + "dev": true, + "license": "Apache-2.0" + }, "node_modules/webdriverio": { "version": "9.14.0", "resolved": "https://registry.npmjs.org/webdriverio/-/webdriverio-9.14.0.tgz", From 139fa2b3f22aa3d343f466a340b046ad4aee7d9f Mon Sep 17 00:00:00 2001 From: Maribeth Moffatt Date: Fri, 19 Sep 2025 13:53:57 -0700 Subject: [PATCH 26/29] fix: handle pointercancel only for drags (#9373) --- core/gesture.ts | 9 +++++++++ core/touch.ts | 1 - 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/core/gesture.ts b/core/gesture.ts index 4c65c1d3842..fa3d8a15138 100644 --- a/core/gesture.ts +++ b/core/gesture.ts @@ -467,6 +467,15 @@ export class Gesture { /* opt_noCaptureIdentifier */ true, ), ); + this.boundEvents.push( + browserEvents.conditionalBind( + document, + 'pointercancel', + null, + this.handleUp.bind(this), + /* opt_noCaptureIdentifier */ true, + ), + ); e.preventDefault(); e.stopPropagation(); diff --git a/core/touch.ts b/core/touch.ts index 9af3b1f9494..8fb2cd2298c 100644 --- a/core/touch.ts +++ b/core/touch.ts @@ -46,7 +46,6 @@ export const TOUCH_MAP: {[key: string]: string[]} = { 'mouseup': ['pointerup', 'pointercancel'], 'touchend': ['pointerup'], 'touchcancel': ['pointercancel'], - 'pointerup': ['pointerup', 'pointercancel'], }; /** PID of queued long-press task. */ From e731222464a684a31322f0fe4d9f84d5b5fbecca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Sep 2025 09:14:54 -0700 Subject: [PATCH 27/29] chore(deps): bump eslint from 9.34.0 to 9.36.0 (#9376) Bumps [eslint](https://github.com/eslint/eslint) from 9.34.0 to 9.36.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/v9.34.0...v9.36.0) --- updated-dependencies: - dependency-name: eslint dependency-version: 9.36.0 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 | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index eb079027594..0a51f0521e1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -414,9 +414,9 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz", - "integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==", + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", + "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", "dev": true, "license": "MIT", "dependencies": { @@ -540,9 +540,9 @@ "license": "MIT" }, "node_modules/@eslint/js": { - "version": "9.34.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.34.0.tgz", - "integrity": "sha512-EoyvqQnBNsV1CWaEJ559rxXL4c8V92gxirbawSmVUOWXlsRxxQXl6LmCpdUblgxgSkDIqKnhzba2SjRTI/A5Rw==", + "version": "9.36.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.36.0.tgz", + "integrity": "sha512-uhCbYtYynH30iZErszX78U+nR3pJU3RHGQ57NXy5QupD4SBVwDeU8TNBy+MjMngc1UyIW9noKqsRqfjQTBU2dw==", "dev": true, "license": "MIT", "engines": { @@ -3994,19 +3994,19 @@ } }, "node_modules/eslint": { - "version": "9.34.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.34.0.tgz", - "integrity": "sha512-RNCHRX5EwdrESy3Jc9o8ie8Bog+PeYvvSR8sDGoZxNFTvZ4dlxUB3WzQ3bQMztFrSRODGrLLj8g6OFuGY/aiQg==", + "version": "9.36.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.36.0.tgz", + "integrity": "sha512-hB4FIzXovouYzwzECDcUkJ4OcfOEkXTv2zRY6B9bkwjx/cprAq0uvm1nl7zvQ0/TsUk0zQiN4uPfJpB9m+rPMQ==", "dev": true, "license": "MIT", "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", "@eslint/config-array": "^0.21.0", "@eslint/config-helpers": "^0.3.1", "@eslint/core": "^0.15.2", "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "9.34.0", + "@eslint/js": "9.36.0", "@eslint/plugin-kit": "^0.3.5", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", From 2336b874a9e63d4d1d0af10496be4b4c5610f386 Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Mon, 22 Sep 2025 13:55:44 -0700 Subject: [PATCH 28/29] chore: Remove obsolete demos. (#9377) --- demos/minimap/icon.png | Bin 4243 -> 0 bytes demos/minimap/index.html | 91 ---- demos/minimap/minimap.js | 302 -------------- demos/mobile/README.md | 53 --- demos/mobile/android/.gitignore | 27 -- demos/mobile/android/README.md | 45 -- demos/mobile/android/app/.gitignore | 7 - demos/mobile/android/app/build.gradle | 64 --- demos/mobile/android/app/proguard-rules.pro | 21 - .../ExampleInstrumentedTest.java | 26 -- .../android/app/src/main/AndroidManifest.xml | 21 - .../webview/BlocklyWebViewFragment.java | 40 -- .../android/webview/JsDialogHelper.java | 150 ------- .../android/webview/WebChromeClient.java | 32 -- .../android/webview/demo/MainActivity.java | 18 - .../drawable-v24/ic_launcher_foreground.xml | 34 -- .../res/drawable/ic_launcher_background.xml | 74 ---- .../app/src/main/res/layout/activity_main.xml | 17 - .../app/src/main/res/layout/js_prompt.xml | 37 -- .../res/mipmap-anydpi-v26/ic_launcher.xml | 5 - .../mipmap-anydpi-v26/ic_launcher_round.xml | 5 - .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 3056 -> 0 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 5024 -> 0 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 2096 -> 0 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 2858 -> 0 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 4569 -> 0 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 7098 -> 0 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 6464 -> 0 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 10676 -> 0 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 9250 -> 0 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 15523 -> 0 bytes .../app/src/main/res/values/colors.xml | 6 - .../src/main/res/values/js_dialog_helper.xml | 7 - .../app/src/main/res/values/strings.xml | 3 - .../app/src/main/res/values/styles.xml | 11 - .../blocklywebview/ExampleUnitTest.java | 17 - demos/mobile/android/build.gradle | 27 -- demos/mobile/android/gradle.properties | 13 - .../android/gradle/wrapper/gradle-wrapper.jar | Bin 54708 -> 0 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 - demos/mobile/android/gradlew | 172 -------- demos/mobile/android/gradlew.bat | 84 ---- demos/mobile/android/settings.gradle | 1 - demos/mobile/html/.gitignore | 4 - demos/mobile/html/index.html | 31 -- demos/mobile/html/ln_resources.sh | 22 - demos/mobile/html/toolbox_standard.js | 333 --------------- demos/mobile/ios/.gitignore | 25 -- .../Blockly WebView.xcodeproj/project.pbxproj | 390 ------------------ .../contents.xcworkspacedata | 7 - .../xcshareddata/IDEWorkspaceChecks.plist | 8 - .../xcschemes/xcschememanagement.plist | 19 - .../ios/Blockly WebView/AppDelegate.swift | 46 --- .../AppIcon.appiconset/Contents.json | 98 ----- .../Assets.xcassets/Contents.json | 6 - .../Base.lproj/LaunchScreen.storyboard | 25 -- .../Base.lproj/Main.storyboard | 44 -- demos/mobile/ios/Blockly WebView/Info.plist | 45 -- .../ios/Blockly WebView/ViewController.swift | 110 ----- demos/mobile/ios/cp_resources.sh | 21 - 60 files changed, 2650 deletions(-) delete mode 100644 demos/minimap/icon.png delete mode 100644 demos/minimap/index.html delete mode 100644 demos/minimap/minimap.js delete mode 100644 demos/mobile/README.md delete mode 100644 demos/mobile/android/.gitignore delete mode 100644 demos/mobile/android/README.md delete mode 100644 demos/mobile/android/app/.gitignore delete mode 100644 demos/mobile/android/app/build.gradle delete mode 100644 demos/mobile/android/app/proguard-rules.pro delete mode 100644 demos/mobile/android/app/src/androidTest/java/com/example/blocklywebview/ExampleInstrumentedTest.java delete mode 100644 demos/mobile/android/app/src/main/AndroidManifest.xml delete mode 100644 demos/mobile/android/app/src/main/java/com/google/blockly/android/webview/BlocklyWebViewFragment.java delete mode 100644 demos/mobile/android/app/src/main/java/com/google/blockly/android/webview/JsDialogHelper.java delete mode 100644 demos/mobile/android/app/src/main/java/com/google/blockly/android/webview/WebChromeClient.java delete mode 100644 demos/mobile/android/app/src/main/java/com/google/blockly/android/webview/demo/MainActivity.java delete mode 100644 demos/mobile/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml delete mode 100644 demos/mobile/android/app/src/main/res/drawable/ic_launcher_background.xml delete mode 100644 demos/mobile/android/app/src/main/res/layout/activity_main.xml delete mode 100644 demos/mobile/android/app/src/main/res/layout/js_prompt.xml delete mode 100644 demos/mobile/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml delete mode 100644 demos/mobile/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml delete mode 100644 demos/mobile/android/app/src/main/res/mipmap-hdpi/ic_launcher.png delete mode 100644 demos/mobile/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png delete mode 100644 demos/mobile/android/app/src/main/res/mipmap-mdpi/ic_launcher.png delete mode 100644 demos/mobile/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png delete mode 100644 demos/mobile/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 demos/mobile/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png delete mode 100644 demos/mobile/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 demos/mobile/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png delete mode 100644 demos/mobile/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png delete mode 100644 demos/mobile/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png delete mode 100644 demos/mobile/android/app/src/main/res/values/colors.xml delete mode 100644 demos/mobile/android/app/src/main/res/values/js_dialog_helper.xml delete mode 100644 demos/mobile/android/app/src/main/res/values/strings.xml delete mode 100644 demos/mobile/android/app/src/main/res/values/styles.xml delete mode 100644 demos/mobile/android/app/src/test/java/com/example/blocklywebview/ExampleUnitTest.java delete mode 100644 demos/mobile/android/build.gradle delete mode 100644 demos/mobile/android/gradle.properties delete mode 100644 demos/mobile/android/gradle/wrapper/gradle-wrapper.jar delete mode 100644 demos/mobile/android/gradle/wrapper/gradle-wrapper.properties delete mode 100755 demos/mobile/android/gradlew delete mode 100644 demos/mobile/android/gradlew.bat delete mode 100644 demos/mobile/android/settings.gradle delete mode 100644 demos/mobile/html/.gitignore delete mode 100644 demos/mobile/html/index.html delete mode 100755 demos/mobile/html/ln_resources.sh delete mode 100644 demos/mobile/html/toolbox_standard.js delete mode 100644 demos/mobile/ios/.gitignore delete mode 100644 demos/mobile/ios/Blockly WebView.xcodeproj/project.pbxproj delete mode 100644 demos/mobile/ios/Blockly WebView.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 demos/mobile/ios/Blockly WebView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 demos/mobile/ios/Blockly WebView.xcodeproj/xcuserdata/marshalla.xcuserdatad/xcschemes/xcschememanagement.plist delete mode 100644 demos/mobile/ios/Blockly WebView/AppDelegate.swift delete mode 100644 demos/mobile/ios/Blockly WebView/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 demos/mobile/ios/Blockly WebView/Assets.xcassets/Contents.json delete mode 100644 demos/mobile/ios/Blockly WebView/Base.lproj/LaunchScreen.storyboard delete mode 100644 demos/mobile/ios/Blockly WebView/Base.lproj/Main.storyboard delete mode 100644 demos/mobile/ios/Blockly WebView/Info.plist delete mode 100644 demos/mobile/ios/Blockly WebView/ViewController.swift delete mode 100755 demos/mobile/ios/cp_resources.sh diff --git a/demos/minimap/icon.png b/demos/minimap/icon.png deleted file mode 100644 index 870caa070d8e4a9f1a295cad8c4570d8132694cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4243 zcmV;E5Nz*>P)m>y01k)T2aXydfY2)Iv)k5fK2K zca|)}t5F*gWgvs;m7EK(nAwxx8SZTLwhC8Bl$TnUu6C{lGO*s>?%uvTxJyj0bp7z4_Z4hc_x;NsycE&0k;p^_8V7cY1ezbMrTM`gaKCg7u8c z?)mR`NiSV$T&jh&XFUJK_4ZS<@-$eU{9g|K@`s&246EVv$fz0-(R-cuwt8ECe(>kY zS7%(JC+(zQF%J(3R(ZzfyBQ~3WvgdLYC2v7sWZTGygeDLKoDvdX1 zZy6*m4wutBoU`&wjdnZzF&5uy)OhcS7Gw+}5<-MwI1emh8kB>lSjmtvm3hWxuUM{S z&DOSn6EgzX`!m>zWG zm5>a?j8X{e%{ehf=7E)jE1PM4&S|em8}D26$Op;&f(4b0OjoGW%$9$-*{U{uxZ>;LKe0x zy{!cau&=z2q}&~Ck4$mS!NPj9ywO-j5gJ1KRN*#_vhtW#hFwT=ZU|?Vf zS%;Mj%Rm6hmQ;Z@RE@`DvM$?xU@G6dxF!RQ;>j&W1WL&ZNqy+5BnXDZI1U;J7EoAk zHF8#V&k0y!?vCI~TL6lQ85{2^n*(AJ)~zcXs8|JvQUF)3@>6ODB^U)G%wi17G9Qix z%$y%~dv_1K@$e*rFjM7X(t9?6)XdC8QmQ0Q1Y&({1!JQ_$FTUNLCIP3Q8G zfPA^19eoeLD($ee0Ojx?!$!1X%wRj)^GyBx2moMm@YFt?hh{$=nV@OLe^52Etv2)=a{k6fd#+< z$Htwd8Ck%j?X;6T08f6jcR1+{QOqcv0hriT#*^po#5E8?)oM$Nfn`jEC$h1Z%AE)x z0RW5CyQG{U^c2Jau!bTgmfyP4L@cSH9=Tu*U#Wt=mG#(_AbB1iz@qBt`hAgT0+e zdGfykDX*_yy4YShk6;NOg~0}>lu!bIz%)WxnV!H%sdZL0e;QLr5FpSm>MrCApWeTX zh$k1V2B8RFJy;T@=O=HEFxDMV&5D?T06?G$#cC~Rd6EXS^ZbOn%+tR}2!cgL#ItV} z#Ds{`rB)B4M2FwRJItJ$a#&6PKs^57>{kS1R_3o#lmbAYlC`*bkas*(6;*}60tF&CqN$-M841}l0nWT+E#z9-8Wwpi4Ex1cpt!zvspe>u z`?b~f!QTGT>Ut1JoSx5s2nX5V^Sv!%zT95T$~@NLsLH!}Hr-*qNl=|UzVJRU53E4f zue7he6Q_Z$0Z?yp(67dioUW-p4Ww?ziE$1QwbZRpYgGYos5G$O84VZ!hyx)jV9(4< zQ+(Ic_Ilcib(n@xRu=UjdZ*Dj`19vq-|lyQ_P1Ys`uUIk=@+aaPV2VJy@yt(bFsC& z)qmiL{^iQ`?qrlk$@ZZ8-&=p8ZzjRgmfcCuIukf$l$T0gNH3^G_knpIYt}YaYfG_? z-&Nt*jJ4pA$!8+|;oLOi#)r$xy`pNz(IC&4;;@wfGt>gz%SXGT0Rsp`AqA56z|4e* zO2|vCWkz@YEK!5+(Mi%ql$6#;A#Xg`MnnJ< zQih@4yT6?zaXuOhyGMg;L=s!gWY`<6U0gxL+*bGche}B6-At`~^T?{~PVZiEl-cg` zE{zi(4T^C+Oc#s9d4866)l$-lrEs8@Ys*CbG+sbNA%MNN6KjaLa#iIl0}wwxMLfDV z=Bdp;Hf5xAZYzl>#q2VKRB1iRCwUY_`EUSId1st+%rsj*458AF{9e{8oxRsTq_c!b z<$M{|_S?chIPS`Oz5cgB@H`yfe-KFYMMj(`{a}3fsOp1{l>s-S+92=mWrNb0qkKFn zO9Ii&C8CgsZf0*Gc_QzHQix#5f3bJxUjHzwidY9@Qzk(~Oi|igznGXtT?K)y%E<(U zFAjUdC}?cH-$VprcI5934u@r43&KG@Ijf?@#yY8*or@cZ45*;RvY)d#t1!c_4*vq| z9kUk7_-YnbfUyd44-DYFdyw^S_xC;diM2NljrHCG?~exnGyO@-p2!;`KqxJyY0goe z9p%}v`8SiQY;IgiE=X_&5STe1=WIuRy1BJ^`P%A*<-(fM+0xnlYybd-eTM3sjZA;3 zp2R=9e7%{}fg#lTTapfJ9@d{L?~f^Iv085wWX7h-%JHpk-YaG^Jg8=wdg<)3SjUPS zpwLoDA)Z!kGjb_zb@!H%bQZAFX{jmpiCS5rR=79m_44ew#gwgu#g$GfHySIATKozW zycFWyc1LUeV(;##oJ=ZY;3;L!NbLlVIAEcq5CQ@Cw7O(T=5}}g{^00o>SZ=y2S?io zV7#r4&%qOC;i*io6fQO5_b#;K@Fle0ECLoGX+=NZ{IDp>yrBI3lN}`wG2rUAZWxLhi`r*b$ z|MBrpv!Zb1?+y-sfA40mn1G}A+iRa(`$;3I<0-c!QK0qir8jsX;(BxG;NA3N&xHsl0f$~D1 zz94g<*yWmVt2Mxvg3@PN3|u6NQ{u)n#}v!175U1-JEHrEE(L<&3~ zE6ZBjUo6of@>15HM>_aONqOxWGQ(G2i82q8bn2916zY{`jcoaN-k9Edr}OW>{PBbC zu$d<30jxBw#qokIDBk;%ntGnC3@lbxQ3zm$jSZMsIZY{0V51&KN*;}^e>iW5m?qI$ zr?J$mX(i8vd`AoyH5Gmq-O*5DaqO`RV(5;F&%U}p8khh4<11+ry;)$f9(C5D;aCI1(yEIZr3LJI&OCVvbmW)|REu}-3Z0mhXdmyVgqlSGLKZyZquB%@nD2W>@Ev@A7t+3swH|nvR;`Ex5);zG7 zcbZBjwHOfg5BsOyWsiPL^IN+Dj? zEpI`v072laCULxhbC&YJTdQ@(uD|zAqy9|Q=GW4t!7~ed%C49SlaFKIvs6Qm ppYuIhGE=Z#;>YprE6$&N{6A75S0b+!umb=9002ovPDHLkV1l|SBYyw@ diff --git a/demos/minimap/index.html b/demos/minimap/index.html deleted file mode 100644 index 1a8fd357dea..00000000000 --- a/demos/minimap/index.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - Blockly Demo: Minimap - - - - - - - -

Blockly > - Demos > Minimap

- -

This is a simple demo showing how a minimap can be implemented.

- - - - - - -
-
-
-
-
- - - - - - - - diff --git a/demos/minimap/minimap.js b/demos/minimap/minimap.js deleted file mode 100644 index a4343899ad6..00000000000 --- a/demos/minimap/minimap.js +++ /dev/null @@ -1,302 +0,0 @@ -/** - - * Copyright 2017 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ - -/** - * @fileoverview JavaScript for Blockly's Minimap demo. - */ -'use strict'; - -/** - * Creating a separate namespace for minimap. - */ -var Minimap = {}; - -/** - * Initialize the workspace and minimap. - * @param {!Workspace} workspace The main workspace of the user. - * @param {!Workspace} minimap The workspace that will be used as a minimap. - */ -Minimap.init = function(workspace, minimap) { - this.workspace = workspace; - this.minimap = minimap; - - // Adding scroll callback functionality to vScroll and hScroll just for this demo. - // IMPORTANT: This should be changed when there is proper UI event handling - // API available and should be handled by workspace's event listeners. - this.workspace.scrollbar.vScroll.setHandlePosition = function(newPosition) { - this.handlePosition_ = newPosition; - this.svgHandle_.setAttribute(this.positionAttribute_, this.handlePosition_); - - // Code above is same as the original setHandlePosition function in core/scrollbar.js. - // New code starts from here. - - // Get the absolutePosition. - var absolutePosition = (this.handlePosition_ / this.ratio); - - // Firing the scroll change listener. - Minimap.onScrollChange(absolutePosition, this.horizontal_); - }; - - // Adding call back for horizontal scroll. - this.workspace.scrollbar.hScroll.setHandlePosition = function(newPosition) { - this.handlePosition_ = newPosition; - this.svgHandle_.setAttribute(this.positionAttribute_, this.handlePosition_); - - // Code above is same as the original setHandlePosition function in core/scrollbar.js. - // New code starts from here. - - // Get the absolutePosition. - var absolutePosition = (this.handlePosition_ / this.ratio); - - // Firing the scroll change listener. - Minimap.onScrollChange(absolutePosition, this.horizontal_); - }; - - - // Required to stop a positive feedback loop when user clicks minimap - // and the scroll changes, which in turn may change minimap. - this.disableScrollChange = false; - - // Listen to events on the main workspace. - this.workspace.addChangeListener(Minimap.mirrorEvent); - - //Get rectangle bounding the minimap div. - this.rect = document.getElementById('mapDiv').getBoundingClientRect(); - - // Create a svg overlay on the top of mapDiv for the minimap. - this.svg = Blockly.utils.dom.createSvgElement('svg', { - 'xmlns': Blockly.utils.dom.SVG_NS, - 'xmlns:html': Blockly.utils.dom.HTML_NS, - 'xmlns:xlink': Blockly.utils.dom.XLINK_NS, - 'version': '1.1', - 'height': this.rect.bottom-this.rect.top, - 'width': this.rect.right-this.rect.left, - 'class': 'minimap', - }, document.getElementById('mapDiv')); - this.svg.style.top = this.rect.top + 'px'; - this.svg.style.left = this.rect.left + 'px'; - - // Creating a rectangle in the minimap that represents current view. - Blockly.utils.dom.createSvgElement('rect', { - 'width': 100, - 'height': 100, - 'class': 'mapDragger' - }, this.svg); - - // Rectangle in the minimap that represents current view. - this.mapDragger = this.svg.childNodes[0]; - - // Adding mouse events to the rectangle, to make it Draggable. - // Using Blockly.browserEvents.bind to attach mouse/touch listeners. - Blockly.browserEvents.bind( - this.mapDragger, 'mousedown', null, Minimap.mousedown); - - //When the window change, we need to resize the minimap window. - window.addEventListener('resize', Minimap.repositionMinimap); - - // Mouse up event for the minimap. - this.svg.addEventListener('mouseup', Minimap.updateMapDragger); - - //Boolean to check whether I am dragging the surface or not. - this.isDragging = false; -}; - -Minimap.mousedown = function(e) { - // Using Blockly.browserEvents.bind to attach mouse/touch listeners. - Minimap.mouseMoveBindData = Blockly.browserEvents.bind( - document, 'mousemove', null, Minimap.mousemove); - Minimap.mouseUpBindData = - Blockly.browserEvents.bind(document, 'mouseup', null, Minimap.mouseup); - - Minimap.isDragging = true; - e.stopPropagation(); -}; - -Minimap.mouseup = function(e) { - Minimap.isDragging = false; - // Removing listeners. - Blockly.browserEvents.unbind(Minimap.mouseUpBindData); - Blockly.browserEvents.unbind(Minimap.mouseMoveBindData); - Minimap.updateMapDragger(e); - e.stopPropagation(); -}; - -Minimap.mousemove = function(e) { - if (Minimap.isDragging) { - Minimap.updateMapDragger(e); - e.stopPropagation(); - } -}; - -/** - * Run non-UI events from the main workspace on the minimap. - * @param {!Blockly.Events.Abstract} event Event that triggered in the main - * workspace. - */ -Minimap.mirrorEvent = function(event) { - if (event.isUiEvent) { - return; // Don't mirror UI events. - } - // Convert event to JSON. This could then be transmitted across the net. - var json = event.toJson(); - // Convert JSON back into an event, then execute it. - var minimapEvent = Blockly.Events.fromJson(json, Minimap.minimap); - minimapEvent.run(true); - Minimap.scaleMinimap(); - Minimap.setDraggerHeight(); - Minimap.setDraggerWidth(); -}; - -/** - * Called when window is resized. Repositions the minimap overlay. - */ -Minimap.repositionMinimap = function() { - Minimap.rect = document.getElementById('mapDiv').getBoundingClientRect(); - Minimap.svg.style.top = Minimap.rect.top + 'px'; - Minimap.svg.style.left = Minimap.rect.left + 'px'; -}; - -/** - * Updates the rectangle's height. - */ -Minimap.setDraggerHeight = function() { - var workspaceMetrics = Minimap.workspace.getMetrics(); - var draggerHeight = (workspaceMetrics.viewHeight / Minimap.workspace.scale) * - Minimap.minimap.scale; - // It's zero when first block is placed. - if (draggerHeight === 0) { - return; - } - Minimap.mapDragger.setAttribute('height', draggerHeight); -}; - -/** - * Updates the rectangle's width. - */ -Minimap.setDraggerWidth = function() { - var workspaceMetrics = Minimap.workspace.getMetrics(); - var draggerWidth = (workspaceMetrics.viewWidth / Minimap.workspace.scale) * - Minimap.minimap.scale; - // It's zero when first block is placed. - if (draggerWidth === 0) { - return; - } - Minimap.mapDragger.setAttribute('width', draggerWidth); -}; - - -/** - * Updates the overall position of the viewport of the minimap by appropriately - * using translate functions. - */ -Minimap.scaleMinimap = function() { - var minimapBoundingBox = Minimap.minimap.getBlocksBoundingBox(); - var workspaceBoundingBox = Minimap.workspace.getBlocksBoundingBox(); - var workspaceMetrics = Minimap.workspace.getMetrics(); - var minimapMetrics = Minimap.minimap.getMetrics(); - - // Scaling the minimap such that all the blocks can be seen in the viewport. - // This padding is default because this is how to scrollbar(in main workspace) - // is implemented. - var topPadding = (workspaceMetrics.viewHeight) * Minimap.minimap.scale / - (2 * Minimap.workspace.scale); - var sidePadding = (workspaceMetrics.viewWidth) * Minimap.minimap.scale / - (2 * Minimap.workspace.scale); - - // If actual padding is more than half view ports height, - // change it to actual padding. - if ((workspaceBoundingBox.y * Minimap.workspace.scale - - workspaceMetrics.contentTop) * - Minimap.minimap.scale / Minimap.workspace.scale > topPadding) { - topPadding = (workspaceBoundingBox.y * Minimap.workspace.scale - - workspaceMetrics.contentTop) * - Minimap.minimap.scale / Minimap.workspace.scale; - } - - // If actual padding is more than half view ports height, - // change it to actual padding. - if ((workspaceBoundingBox.x * Minimap.workspace.scale - - workspaceMetrics.contentLeft) * - Minimap.minimap.scale / Minimap.workspace.scale > sidePadding) { - sidePadding = (workspaceBoundingBox.x * Minimap.workspace.scale - - workspaceMetrics.contentLeft) * - Minimap.minimap.scale / Minimap.workspace.scale; - } - - var scalex = (minimapMetrics.viewWidth - 2 * sidePadding) / - minimapBoundingBox.width; - var scaley = (minimapMetrics.viewHeight - 2 * topPadding) / - minimapBoundingBox.height; - Minimap.minimap.setScale(Math.min(scalex, scaley)); - - // Translating the minimap. - Minimap.minimap.translate( - -minimapMetrics.contentLeft * Minimap.minimap.scale + sidePadding, - -minimapMetrics.contentTop * Minimap.minimap.scale + topPadding); -}; - -/** - * Handles the onclick event on the minimapBoundingBox. - * Changes mapDraggers position. - * @param {!Event} e Event from the mouse click. - */ -Minimap.updateMapDragger = function(e) { - var y = e.clientY; - var x = e.clientX; - var draggerHeight = Minimap.mapDragger.getAttribute('height'); - var draggerWidth = Minimap.mapDragger.getAttribute('width'); - - var finalY = y - Minimap.rect.top - draggerHeight / 2; - var finalX = x - Minimap.rect.left - draggerWidth / 2; - - var maxValidY = (Minimap.workspace.getMetrics().contentHeight - - Minimap.workspace.getMetrics().viewHeight) * Minimap.minimap.scale; - var maxValidX = (Minimap.workspace.getMetrics().contentWidth - - Minimap.workspace.getMetrics().viewWidth) * Minimap.minimap.scale; - - if (y + draggerHeight / 2 > Minimap.rect.bottom) { - finalY = Minimap.rect.bottom - Minimap.rect.top - draggerHeight; - } else if (y < Minimap.rect.top + draggerHeight / 2) { - finalY = 0; - } - - if (x + draggerWidth / 2 > Minimap.rect.right) { - finalX = Minimap.rect.right - Minimap.rect.left - draggerWidth; - } else if (x < Minimap.rect.left + draggerWidth / 2) { - finalX = 0; - } - - // Do not go below lower bound of scrollbar. - if (finalY > maxValidY) { - finalY = maxValidY; - } - if (finalX > maxValidX) { - finalX = maxValidX; - } - Minimap.mapDragger.setAttribute('y', finalY); - Minimap.mapDragger.setAttribute('x', finalX); - // Required, otherwise creates a feedback loop. - Minimap.disableScrollChange = true; - Minimap.workspace.scrollbar.vScroll.set((finalY * Minimap.workspace.scale) / - Minimap.minimap.scale); - Minimap.workspace.scrollbar.hScroll.set((finalX * Minimap.workspace.scale) / - Minimap.minimap.scale); - Minimap.disableScrollChange = false; -}; - -/** - * Handles the onclick event on the minimapBoundingBox, parameters are passed by - * the event handler. - * @param {number} position This is the absolute position of the scrollbar. - * @param {boolean} horizontal Informs if the change event if for - * horizontal (true) or vertical (false) scrollbar. - */ -Minimap.onScrollChange = function(position, horizontal) { - if (!Minimap.disableScrollChange) { - Minimap.mapDragger.setAttribute(horizontal ? 'x' : 'y', - position * Minimap.minimap.scale / Minimap.workspace.scale); - } -}; diff --git a/demos/mobile/README.md b/demos/mobile/README.md deleted file mode 100644 index 168690e55db..00000000000 --- a/demos/mobile/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# Blockly on Mobile Devices - -This directory contains three examples of running the Blockly library on mobile -devices. The `html/` directory is a example of configuring a webpage for touch -devices, with a Blockly workspace that fills the screen. - -The `mobile/html/` is also the basis for the Android and iOS demos. Each native -app copies this demo into the app's local resources, and required Blockly -library files, and hosts them in an embedded WebView. - -Thus, developers can quickly iterate within the `mobile/html/` directory, and -see changes in both the Android and iOS native apps. - -## Running the Mobile HTML Demo - -Before running the mobile HTML demo, you need to create some symbolic links -in your local file system. Run the `mobile/html/ln_resources.sh` file from -the `mobile/html/` directory. This mimics the relative locations of the -Blockly files seen when loading the page in a native app's embedded WebView. - -After doing this, opening `mobile/html/index.html` should open normally, -filling the page with one large Blockly workspace. - -## The Android App - -### Build and Run - -Open the `demos/mobile/android/` directory in Android Studio. The project -files in the directory should be ready to build and run the demo in an emulator -or connected device. - -### Android Copy Tasks - -If you edit the `mobile/html/` demo to include new files, you will need to -update the native app project files to also copy those files. - -In the Android project, two Gradle tasks are responsible for the copies. -In `mobile/android/app/build.gradle`, the tasks `copyBlocklyHtmlFile` and -`copyBlocklyMoreFiles` configure the copy actions. - -## The iOS App - -### Build and Run - -Open the `demos/mobile/iOS/` directory in XCode. The project files in the -directory should be ready to build and run the demo in a simulator or connected -device. - -### iOS Copy Script - -The XCode project call out to `mobile/ios/cp_resources.sh` to copy the required -HTML and related files. If you've edited the `mobile/html/` demo to require new -files, update this script to copy these files, too. diff --git a/demos/mobile/android/.gitignore b/demos/mobile/android/.gitignore deleted file mode 100644 index 3ba2b2b61bd..00000000000 --- a/demos/mobile/android/.gitignore +++ /dev/null @@ -1,27 +0,0 @@ -/build -/captures -/app/src/main/assets/blockly -.settings -.project - -# Local Settings -local.properties - -# Project files -*.komodoproject -.gradle -*.iml -.idea - -# Build files -*.pyc -*.apk -*.ap_ -*.class -*.dex - -# OSX Files -.DS_Store - -# Windows Files -Thumb.db diff --git a/demos/mobile/android/README.md b/demos/mobile/android/README.md deleted file mode 100644 index 31f968feab4..00000000000 --- a/demos/mobile/android/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# Blockly in an Android WebView - -This code demonstrates how to get Blockly running in an Android app by -embedding it in a WebView. - -### BlocklyWebViewFragment - -Most of the work is done within the fragment class `BlocklyWebViewFragment`. -This fragment instantiates the WebView, loads the HTML -(`assets/blockly/webview.html`, copied from `demos/mobile/html/index.html`), -and provides a few helper methods. - -### Copying web assets with gradle - -This android project copies the necessary files from the main Blockly -repository (i.e., parent directory). In `app/build.gradle`, note the -`copyBlocklyHtmlFile` and `copyBlocklyMoreFiles` tasks. - -In your own project, the HTML and related files can be placed directly in the -`assets/blockly` directory without the copy step. However, using the copy tasks -simplifies the synchronization with an iOS app using the same files. - -### Loading Block Definitions and Generator functions - -The `webview.html` loads the block definitions and generator functions directly -into the page, without support or coordination with the Android classes. This -assumes the app will always utilize the same blocks. This does not mean all -blocks are visible to the user all the time; that is controlled by the toolbox -and workspace files. This should accommodate almost all applications. - -This does mean loading your own block definitions and generators will involve -editing the HTML, adding you own ` - - - - - - -
- - - diff --git a/demos/mobile/html/ln_resources.sh b/demos/mobile/html/ln_resources.sh deleted file mode 100755 index 8f7a8b979bd..00000000000 --- a/demos/mobile/html/ln_resources.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -e -# -# Create symbolic links in this directory for the -# Blockly library files used by this demo's index.html. - -if [[ ! -e ../../../dist/blockly_compressed.js ]]; then - echo "ERROR: Could not locate blockly_compressed.js. Run from demos/mobile/html/" 1>&2 - exit 1 # terminate and indicate error -fi - -if [ ! -L blockly_compressed.js ]; then - ln -s ../../../dist/blockly_compressed.js blockly_compressed.js -fi -if [ ! -L blocks_compressed.js ]; then - ln -s ../../../dist/blocks_compressed.js blocks_compressed.js -fi -if [ ! -L media ]; then - ln -s ../../../media media -fi -if [ ! -L msg ]; then - ln -s ../../../build/msg msg -fi diff --git a/demos/mobile/html/toolbox_standard.js b/demos/mobile/html/toolbox_standard.js deleted file mode 100644 index 20326882fc5..00000000000 --- a/demos/mobile/html/toolbox_standard.js +++ /dev/null @@ -1,333 +0,0 @@ - -var BLOCKLY_TOOLBOX_XML = BLOCKLY_TOOLBOX_XML || Object.create(null); - -/* BEGINNING BLOCKLY_TOOLBOX_XML ASSIGNMENT. DO NOT EDIT. USE BLOCKLY DEVTOOLS. */ -BLOCKLY_TOOLBOX_XML['standard'] = -// From XML string/file, replace ^\s?(\s*)?(<.*>)$ with \+$1'$2' -// Tweak first and last line. -'' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '10' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '1' -+ '' -+ '' -+ '' -+ '' -+ '10' -+ '' -+ '' -+ '' -+ '' -+ '1' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '123' -+ '' -+ '' -+ '' -+ '' -+ '1' -+ '' -+ '' -+ '' -+ '' -+ '1' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '9' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '45' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '0' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '3.1' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '64' -+ '' -+ '' -+ '' -+ '' -+ '10' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '50' -+ '' -+ '' -+ '' -+ '' -+ '1' -+ '' -+ '' -+ '' -+ '' -+ '100' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '1' -+ '' -+ '' -+ '' -+ '' -+ '100' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ 'abc' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ 'text' -+ '' -+ '' -+ '' -+ '' -+ 'abc' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ 'text' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ 'text' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ 'abc' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ 'abc' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ 'abc' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ 'abc' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '5' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ 'list' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ 'list' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ 'list' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ 'list' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ ',' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '100' -+ '' -+ '' -+ '' -+ '' -+ '50' -+ '' -+ '' -+ '' -+ '' -+ '0' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '#ff0000' -+ '' -+ '' -+ '' -+ '' -+ '#3333ff' -+ '' -+ '' -+ '' -+ '' -+ '0.5' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ ''; -/* END BLOCKLY_TOOLBOX_XML ASSIGNMENT. DO NOT EDIT. */ diff --git a/demos/mobile/ios/.gitignore b/demos/mobile/ios/.gitignore deleted file mode 100644 index 6c1f837691d..00000000000 --- a/demos/mobile/ios/.gitignore +++ /dev/null @@ -1,25 +0,0 @@ -# Files copied by cp_resources.sh -/Resources/Non-Localized/Blockly - - -# Xcode.gitignore - -## User settings -xcuserdata/ - -## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) -*.xcscmblueprint -*.xccheckout - -## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) -build/ -DerivedData/ -*.moved-aside -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 diff --git a/demos/mobile/ios/Blockly WebView.xcodeproj/project.pbxproj b/demos/mobile/ios/Blockly WebView.xcodeproj/project.pbxproj deleted file mode 100644 index a3f72fcd431..00000000000 --- a/demos/mobile/ios/Blockly WebView.xcodeproj/project.pbxproj +++ /dev/null @@ -1,390 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 50; - objects = { - -/* Begin PBXBuildFile section */ - AB036C55211B89D600CCC9D8 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB036C54211B89D600CCC9D8 /* WebKit.framework */; }; - AB980111211A37B50025AFF2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB980110211A37B50025AFF2 /* AppDelegate.swift */; }; - AB980113211A37B50025AFF2 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB980112211A37B50025AFF2 /* ViewController.swift */; }; - AB980116211A37B50025AFF2 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AB980114211A37B50025AFF2 /* Main.storyboard */; }; - AB980118211A37B70025AFF2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AB980117211A37B70025AFF2 /* Assets.xcassets */; }; - AB98011B211A37B70025AFF2 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AB980119211A37B70025AFF2 /* LaunchScreen.storyboard */; }; - ABA1B7FC212214E7000D3CC5 /* Blockly in Resources */ = {isa = PBXBuildFile; fileRef = ABA1B7FB212214E7000D3CC5 /* Blockly */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - AB036C54211B89D600CCC9D8 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; - AB98010D211A37B50025AFF2 /* Blockly WebView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Blockly WebView.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - AB980110211A37B50025AFF2 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - AB980112211A37B50025AFF2 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - AB980115211A37B50025AFF2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - AB980117211A37B70025AFF2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - AB98011A211A37B70025AFF2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - AB98011C211A37B70025AFF2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - ABA1B7FB212214E7000D3CC5 /* Blockly */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Blockly; path = "Resources/Non-Localized/Blockly"; sourceTree = SOURCE_ROOT; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - AB98010A211A37B50025AFF2 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - AB036C55211B89D600CCC9D8 /* WebKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - AB036C53211B89D500CCC9D8 /* Frameworks */ = { - isa = PBXGroup; - children = ( - AB036C54211B89D600CCC9D8 /* WebKit.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - AB980104211A37B50025AFF2 = { - isa = PBXGroup; - children = ( - AB98010F211A37B50025AFF2 /* Blockly WebView */, - AB98010E211A37B50025AFF2 /* Products */, - AB036C53211B89D500CCC9D8 /* Frameworks */, - ); - sourceTree = ""; - }; - AB98010E211A37B50025AFF2 /* Products */ = { - isa = PBXGroup; - children = ( - AB98010D211A37B50025AFF2 /* Blockly WebView.app */, - ); - name = Products; - sourceTree = ""; - }; - AB98010F211A37B50025AFF2 /* Blockly WebView */ = { - isa = PBXGroup; - children = ( - ABA1B7F9212214B9000D3CC5 /* Resources */, - AB980110211A37B50025AFF2 /* AppDelegate.swift */, - AB980112211A37B50025AFF2 /* ViewController.swift */, - AB980114211A37B50025AFF2 /* Main.storyboard */, - AB980117211A37B70025AFF2 /* Assets.xcassets */, - AB980119211A37B70025AFF2 /* LaunchScreen.storyboard */, - AB98011C211A37B70025AFF2 /* Info.plist */, - ); - path = "Blockly WebView"; - sourceTree = ""; - }; - ABA1B7F9212214B9000D3CC5 /* Resources */ = { - isa = PBXGroup; - children = ( - ABA1B7FA212214C6000D3CC5 /* Non-Localized */, - ); - path = Resources; - sourceTree = ""; - }; - ABA1B7FA212214C6000D3CC5 /* Non-Localized */ = { - isa = PBXGroup; - children = ( - ABA1B7FB212214E7000D3CC5 /* Blockly */, - ); - path = "Non-Localized"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - AB98010C211A37B50025AFF2 /* Blockly WebView */ = { - isa = PBXNativeTarget; - buildConfigurationList = AB98011F211A37B70025AFF2 /* Build configuration list for PBXNativeTarget "Blockly WebView" */; - buildPhases = ( - AB980109211A37B50025AFF2 /* Sources */, - AB98010A211A37B50025AFF2 /* Frameworks */, - ABEDABD1212372E700A66667 /* ShellScript */, - AB98010B211A37B50025AFF2 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "Blockly WebView"; - productName = "Blockly WebView"; - productReference = AB98010D211A37B50025AFF2 /* Blockly WebView.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - AB980105211A37B50025AFF2 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0940; - LastUpgradeCheck = 0940; - ORGANIZATIONNAME = Google; - TargetAttributes = { - AB98010C211A37B50025AFF2 = { - CreatedOnToolsVersion = 9.4.1; - }; - }; - }; - buildConfigurationList = AB980108211A37B50025AFF2 /* Build configuration list for PBXProject "Blockly WebView" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = AB980104211A37B50025AFF2; - productRefGroup = AB98010E211A37B50025AFF2 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - AB98010C211A37B50025AFF2 /* Blockly WebView */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - AB98010B211A37B50025AFF2 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - AB98011B211A37B70025AFF2 /* LaunchScreen.storyboard in Resources */, - AB980118211A37B70025AFF2 /* Assets.xcassets in Resources */, - AB980116211A37B50025AFF2 /* Main.storyboard in Resources */, - ABA1B7FC212214E7000D3CC5 /* Blockly in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - ABEDABD1212372E700A66667 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = ./cp_resources.sh; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - AB980109211A37B50025AFF2 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - AB980113211A37B50025AFF2 /* ViewController.swift in Sources */, - AB980111211A37B50025AFF2 /* AppDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - AB980114211A37B50025AFF2 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - AB980115211A37B50025AFF2 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - AB980119211A37B70025AFF2 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - AB98011A211A37B70025AFF2 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - AB98011D211A37B70025AFF2 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.4; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - AB98011E211A37B70025AFF2 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.4; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - AB980120211A37B70025AFF2 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 3KZF7Q7Q49; - INFOPLIST_FILE = "Blockly WebView/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = "com.google.kidscoding.Blockly-WebView"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - AB980121211A37B70025AFF2 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 3KZF7Q7Q49; - INFOPLIST_FILE = "Blockly WebView/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = "com.google.kidscoding.Blockly-WebView"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - AB980108211A37B50025AFF2 /* Build configuration list for PBXProject "Blockly WebView" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - AB98011D211A37B70025AFF2 /* Debug */, - AB98011E211A37B70025AFF2 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - AB98011F211A37B70025AFF2 /* Build configuration list for PBXNativeTarget "Blockly WebView" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - AB980120211A37B70025AFF2 /* Debug */, - AB980121211A37B70025AFF2 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = AB980105211A37B50025AFF2 /* Project object */; -} diff --git a/demos/mobile/ios/Blockly WebView.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/demos/mobile/ios/Blockly WebView.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 2a4f4ae836a..00000000000 --- a/demos/mobile/ios/Blockly WebView.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/demos/mobile/ios/Blockly WebView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/demos/mobile/ios/Blockly WebView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d6..00000000000 --- a/demos/mobile/ios/Blockly WebView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/demos/mobile/ios/Blockly WebView.xcodeproj/xcuserdata/marshalla.xcuserdatad/xcschemes/xcschememanagement.plist b/demos/mobile/ios/Blockly WebView.xcodeproj/xcuserdata/marshalla.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index e1e71ff066e..00000000000 --- a/demos/mobile/ios/Blockly WebView.xcodeproj/xcuserdata/marshalla.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,19 +0,0 @@ - - - - - SchemeUserState - - Blockly WebView.xcscheme - - orderHint - 0 - - Blockly WebView.xcscheme_^#shared#^_ - - orderHint - 0 - - - - diff --git a/demos/mobile/ios/Blockly WebView/AppDelegate.swift b/demos/mobile/ios/Blockly WebView/AppDelegate.swift deleted file mode 100644 index 1f2bf6eedce..00000000000 --- a/demos/mobile/ios/Blockly WebView/AppDelegate.swift +++ /dev/null @@ -1,46 +0,0 @@ -// -// AppDelegate.swift -// Blockly WebView -// -// Created by Andrew Marshall on 8/7/18. -// Copyright © 2018 Google. All rights reserved. -// - -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. - return true - } - - func applicationWillResignActive(_ application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(_ application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(_ application: UIApplication) { - // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(_ application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(_ application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - - -} - diff --git a/demos/mobile/ios/Blockly WebView/Assets.xcassets/AppIcon.appiconset/Contents.json b/demos/mobile/ios/Blockly WebView/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d8db8d65fd7..00000000000 --- a/demos/mobile/ios/Blockly WebView/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - }, - { - "idiom" : "ios-marketing", - "size" : "1024x1024", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/demos/mobile/ios/Blockly WebView/Assets.xcassets/Contents.json b/demos/mobile/ios/Blockly WebView/Assets.xcassets/Contents.json deleted file mode 100644 index da4a164c918..00000000000 --- a/demos/mobile/ios/Blockly WebView/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/demos/mobile/ios/Blockly WebView/Base.lproj/LaunchScreen.storyboard b/demos/mobile/ios/Blockly WebView/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f83f6fd5810..00000000000 --- a/demos/mobile/ios/Blockly WebView/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/demos/mobile/ios/Blockly WebView/Base.lproj/Main.storyboard b/demos/mobile/ios/Blockly WebView/Base.lproj/Main.storyboard deleted file mode 100644 index 35c8fdddfc2..00000000000 --- a/demos/mobile/ios/Blockly WebView/Base.lproj/Main.storyboard +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/demos/mobile/ios/Blockly WebView/Info.plist b/demos/mobile/ios/Blockly WebView/Info.plist deleted file mode 100644 index 16be3b68112..00000000000 --- a/demos/mobile/ios/Blockly WebView/Info.plist +++ /dev/null @@ -1,45 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/demos/mobile/ios/Blockly WebView/ViewController.swift b/demos/mobile/ios/Blockly WebView/ViewController.swift deleted file mode 100644 index e9f75dab465..00000000000 --- a/demos/mobile/ios/Blockly WebView/ViewController.swift +++ /dev/null @@ -1,110 +0,0 @@ -// ViewController.swift -// Blockly WebView UI controller. -// -// Created by Andrew Marshall on 8/7/18. -// Copyright © 2018 Google. All rights reserved. -// - -import UIKit -import WebKit - - -/// A basic ViewController for a WebView. -/// It handles the initial page load, and functions like window.prompt(). -class ViewController: UIViewController, WKUIDelegate { - /// The name used to reference this iOS object when executing callbacks from the JS code. - /// If this value is changed, it should also be changed in the `CODE_GENERATOR_BRIDGE_JS` file. - fileprivate static let HOST_HTML = "Blockly/webview.html" - - @IBOutlet weak var webView: WKWebView! - - /// Additional setup after loading the UI NIB. - override func viewDidLoad() { - super.viewDidLoad() - webView.uiDelegate = self - // Do any additional setup after loading the view, typically from a nib. - loadWebContent() - } - - /// Load the root HTML page into the webview. - func loadWebContent() { - if let htmlUrl = Bundle.main.url(forResource: "webview", withExtension: "html", - subdirectory: "Blockly") { - webView.load(URLRequest.init(url: htmlUrl)) - } else { - NSLog("Failed to load HTML. Could not find resource.") - } - } - - /// Handle window.alert() with a native dialog. - func webView(_ webView: WKWebView, - runJavaScriptAlertPanelWithMessage message: String, - initiatedByFrame frame: WKFrameInfo, - completionHandler: @escaping () -> Void) { - - let alert = UIAlertController(title: nil, message: message, preferredStyle: .alert) - let title = NSLocalizedString("OK", comment: "OK Button") - let ok = UIAlertAction(title: title, style: .default) { (action: UIAlertAction) -> Void in - alert.dismiss(animated: true, completion: nil) - } - alert.addAction(ok) - present(alert, animated: true) - completionHandler() - } - - /// Handle window.confirm() with a native dialog. - func webView(_ webView: WKWebView, - runJavaScriptConfirmPanelWithMessage message: String, - initiatedByFrame frame: WKFrameInfo, - completionHandler: @escaping (Bool) -> Void) { - - let alert = UIAlertController(title: nil, message: message, preferredStyle: .alert) - let closeAndHandle = { (okayed: Bool) in - alert.dismiss(animated: true, completion: nil) - completionHandler(okayed) - } - - let okTitle = NSLocalizedString("OK", comment: "OK button title") - let ok = UIAlertAction(title: okTitle, style: .default) { (action: UIAlertAction) -> Void in - closeAndHandle(true) - } - alert.addAction(ok) - - let cancelTitle = NSLocalizedString("Cancel", comment: "Cancel button title") - let cancel = UIAlertAction(title: cancelTitle, style: .default) { - (action: UIAlertAction) -> Void in - closeAndHandle(false) - } - alert.addAction(cancel) - present(alert, animated: true) - } - - /// Handle window.prompt() with a native dialog. - func webView(_ webView: WKWebView, - runJavaScriptTextInputPanelWithPrompt prompt: String, - defaultText: String?, - initiatedByFrame frame: WKFrameInfo, - completionHandler: @escaping (String?) -> Void) { - - let alert = UIAlertController(title: prompt, message: nil, preferredStyle: .alert) - - alert.addTextField { (textField) in - textField.text = defaultText - } - - let okTitle = NSLocalizedString("OK", comment: "OK button title") - let okAction = UIAlertAction(title: okTitle, style: .default) { (_) in - let textInput = alert.textFields![0] as UITextField - completionHandler(textInput.text) - } - alert.addAction(okAction) - - let cancelTitle = NSLocalizedString("Cancel", comment: "Cancel button title") - let cancelAction = UIAlertAction(title: cancelTitle, style: .cancel) { (_) in - completionHandler(nil) - } - alert.addAction(cancelAction) - - present(alert, animated: true) - } -} diff --git a/demos/mobile/ios/cp_resources.sh b/demos/mobile/ios/cp_resources.sh deleted file mode 100755 index afb532bc5d9..00000000000 --- a/demos/mobile/ios/cp_resources.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -set -eux - -BLOCKLY_ROOT=../../.. -IOS_RESOURCES=Resources/Non-Localized/Blockly - -MORE_FILES_TO_COPY=( - "dist/blockly_compressed.js" - "dist/blocks_compressed.js" - "media" - "build/msg" - ) - -mkdir -p $IOS_RESOURCES/media -mkdir -p $IOS_RESOURCES/msg/js -rsync -rp ../html/index.html $IOS_RESOURCES/webview.html -rsync -rp ../html/toolbox_standard.js $IOS_RESOURCES/toolbox_standard.js -for i in "${MORE_FILES_TO_COPY[@]}"; do # The quotes are necessary here - TARGET_DIR=$(dirname $IOS_RESOURCES/$i) - rsync -rp $BLOCKLY_ROOT/$i $TARGET_DIR -done From 587720db28541da2b93cfb61cf25cb6582e7ee88 Mon Sep 17 00:00:00 2001 From: Maribeth Moffatt Date: Mon, 22 Sep 2025 14:32:02 -0700 Subject: [PATCH 29/29] release: update version number to 12.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 0a51f0521e1..2d7aec2ea17 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "blockly", - "version": "12.3.0", + "version": "12.3.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "blockly", - "version": "12.3.0", + "version": "12.3.1", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index b2892977c91..de5778bdbcd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "blockly", - "version": "12.3.0", + "version": "12.3.1", "description": "Blockly is a library for building visual programming editors.", "keywords": [ "blockly"