Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions plugins/block-dynamic-connection/src/dynamic_list_create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,14 @@ const DYNAMIC_LIST_CREATE_MIXIN = {
*/
loadExtraState: function (
this: DynamicListCreateBlock,
state: {[x: string]: any} | string,
state: {itemCount?: number; [x: string]: unknown} | string,
) {
if (typeof state === 'string') {
this.domToMutation(Blockly.utils.xml.textToDom(state));
return;
}

this.itemCount = state['itemCount'];
this.itemCount = state['itemCount'] ?? 0;
// minInputs are added automatically.
for (let i = this.minInputs; i < this.itemCount; i++) {
this.appendValueInput('ADD' + i);
Expand Down
4 changes: 2 additions & 2 deletions plugins/block-dynamic-connection/src/dynamic_text_join.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ const DYNAMIC_TEXT_JOIN_MIXIN = {
*/
loadExtraState: function (
this: DynamicTextJoinBlock,
state: {[x: string]: any} | string,
state: {itemCount?: number; [x: string]: unknown} | string,
) {
if (typeof state === 'string') {
this.domToMutation(Blockly.utils.xml.textToDom(state));
return;
}

this.itemCount = state['itemCount'];
this.itemCount = state['itemCount'] ?? 0;
// minInputs are added automatically.
for (let i = this.minInputs; i < this.itemCount; i++) {
this.appendValueInput('ADD' + i);
Expand Down
2 changes: 1 addition & 1 deletion plugins/block-dynamic-connection/test/dynamic_if.mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ suite('If block', function () {
* Asserts that the if block has the expected inputs.
* @param {!Blockly.Block} block The block to check.
* @param {!Array<RegExp>} expectedInputs The expected inputs.
* @param type {string=} The block type expected. Defaults to 'dynamic_if'.
* @param {string=} type The block type expected. Defaults to 'dynamic_if'.
*/
function assertBlockStructure(block, expectedInputs, type = 'dynamic_if') {
assert.equal(block.type, type);
Expand Down
5 changes: 5 additions & 0 deletions plugins/field-bitmap/src/field-bitmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ export class FieldBitmap extends Blockly.Field {
return editable;
}

/**
* Gets the rectangle built out of dimentions matching SVG's <g> element.
* @returns {Blockly.utils.Rect} The newly created rectangle of same size
* as the SVG element.
*/
getScaledBBox() {
const boundingBox = this.fieldGroup_.getBoundingClientRect();
return new Blockly.utils.Rect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ export class DependentDropdownOptionsChange extends Blockly.Events.BlockBase {
static fromJson(
json: DependentDropdownOptionsChangeJson,
workspace: Blockly.Workspace,
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
event?: any,
): DependentDropdownOptionsChange {
const newEvent = super.fromJson(
Expand Down
2 changes: 1 addition & 1 deletion plugins/keyboard-navigation/src/navigation_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export class NavigationController {
fieldShortcutHandler(workspace, shortcut) {
const cursor = workspace.getCursor();
if (!cursor || !cursor.getCurNode()) {
return;
return false;
}
const curNode = cursor.getCurNode();
if (curNode.getType() === Blockly.ASTNode.types.FIELD) {
Expand Down
6 changes: 3 additions & 3 deletions plugins/migration/bin/fix-imports.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const fixImports = createSubCommand(
let MigrationData;

// TODO (#1211): Make this database format more robust.
/** @type {MigrationData[]} */
/** @type {Array<MigrationData>} */
const database = [
{
import: 'blockly/dart',
Expand Down Expand Up @@ -135,7 +135,7 @@ function fixImport(contents, migrationData) {
* Returns the identifier a given import is assigned to.
* @param {string} contents The string contents of the file to migrate.
* @param {MigrationData} migrationData Data defining what to migrate and how.
* @returns The identifier associated with the import associated with the
* @returns {string} The identifier associated with the import associated with the
* migration data.
*/
function getIdentifier(contents, migrationData) {
Expand All @@ -155,7 +155,7 @@ function getIdentifier(contents, migrationData) {
* with references to the actual import (if any references are found).
* @param {string} contents The string contents of the file to migrate.
* @param {MigrationData} migrationData Data defining what to migrate and how.
* @param identifier
* @param {string} identifier The string to be replaced in the file contents.
* @returns {string} The migrated contents of the file.
*/
function replaceReferences(contents, migrationData, identifier) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export class BlockShadowChange extends Blockly.Events.BlockBase {
static fromJson(
json: BlockChangeJson,
workspace: Blockly.Workspace,
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
event?: any,
): BlockShadowChange {
const newEvent = super.fromJson(
Expand Down
1 change: 1 addition & 0 deletions plugins/workspace-minimap/src/minimap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export class Minimap {
}
if (
event.type === Blockly.Events.BLOCK_CREATE &&
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
(event as any).xml.tagName === 'shadow'
) {
return; // Filter out shadow blocks.
Expand Down
4 changes: 2 additions & 2 deletions plugins/workspace-minimap/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import * as Blockly from 'blockly';
import {toolboxCategories, createPlayground} from '@blockly/dev-tools';
import {Minimap, PositionedMinimap} from '../src/index';
import {PositionedMinimap} from '../src/index';

let minimap = null;
let workspace = null;
Expand Down Expand Up @@ -38,7 +38,7 @@ function createWorkspace(
}

document.addEventListener('DOMContentLoaded', function () {
createPlayground(document.getElementById('root'), createWorkspace as any, {
createPlayground(document.getElementById('root'), createWorkspace, {
toolbox: toolboxCategories,
});
});
2 changes: 1 addition & 1 deletion scripts/gh-predeploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ function createExamplePage(pageRoot, pagePath, demoConfig, isLocal) {
* @param {boolean} isLocal True if building for a local test. False if
* building for gh-pages.
* @param {Function} done Completed callback.
* @returns {Function} Gulp task.
* @returns {Function | undefined} Gulp task.
*/
function prepareExample(exampleDir, isLocal, done) {
const baseDir = 'examples';
Expand Down