Skip to content

Commit 9519333

Browse files
authored
release: v11.0.0
Merge pull request #8164 from google/rc/v11.0.0
2 parents 0e22a79 + 2f15621 commit 9519333

300 files changed

Lines changed: 8181 additions & 13291 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/appengine_deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
path: _deploy/
4343

4444
- name: Deploy to App Engine
45-
uses: google-github-actions/deploy-appengine@v2.0.0
45+
uses: google-github-actions/deploy-appengine@v2.1.0
4646
# For parameters see:
4747
# https://github.com/google-github-actions/deploy-appengine#inputs
4848
with:

appengine/add_timestamps.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ def run_query():
6262
while more:
6363
results, cursor, more = query.fetch_page(PAGE_SIZE, start_cursor=cursor)
6464
handle_results(results)
65-
page_count = page_count + 1
66-
result_count = result_count + len(results)
65+
page_count += 1
66+
result_count += len(results)
6767
print(f'{datetime.datetime.now().strftime("%I:%M:%S %p")} : page {page_count} : {result_count}')
6868

6969
run_query()

blocks/blocks.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
// Former goog.module ID: Blockly.libraryBlocks
88

9-
import * as colour from './colour.js';
109
import * as lists from './lists.js';
1110
import * as logic from './logic.js';
1211
import * as loops from './loops.js';
@@ -18,8 +17,8 @@ import * as variablesDynamic from './variables_dynamic.js';
1817
import type {BlockDefinition} from '../core/blocks.js';
1918

2019
export {
21-
colour,
2220
lists,
21+
logic,
2322
loops,
2423
math,
2524
procedures,
@@ -34,12 +33,12 @@ export {
3433
*/
3534
export const blocks: {[key: string]: BlockDefinition} = Object.assign(
3635
{},
37-
colour.blocks,
3836
lists.blocks,
3937
logic.blocks,
4038
loops.blocks,
4139
math.blocks,
4240
procedures.blocks,
41+
texts.blocks,
4342
variables.blocks,
4443
variablesDynamic.blocks,
4544
);

blocks/colour.ts

Lines changed: 0 additions & 112 deletions
This file was deleted.

blocks/lists.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ const LISTS_CREATE_WITH = {
227227
// Disconnect any children that don't belong.
228228
for (let i = 0; i < this.itemCount_; i++) {
229229
const connection = this.getInput('ADD' + i)!.connection!.targetConnection;
230-
if (connection && connections.indexOf(connection) === -1) {
230+
if (connection && !connections.includes(connection)) {
231231
connection.disconnect();
232232
}
233233
}

blocks/loops.ts

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
createBlockDefinitionsFromJsonArray,
2121
defineBlocks,
2222
} from '../core/common.js';
23+
import * as eventUtils from '../core/events/utils.js';
2324
import '../core/field_dropdown.js';
2425
import '../core/field_label.js';
2526
import '../core/field_number.js';
@@ -334,6 +335,11 @@ export type ControlFlowInLoopBlock = Block & ControlFlowInLoopMixin;
334335
interface ControlFlowInLoopMixin extends ControlFlowInLoopMixinType {}
335336
type ControlFlowInLoopMixinType = typeof CONTROL_FLOW_IN_LOOP_CHECK_MIXIN;
336337

338+
/**
339+
* The language-neutral ID for when the reason why a block is disabled is
340+
* because the block is only valid inside of a loop.
341+
*/
342+
const CONTROL_FLOW_NOT_IN_LOOP_DISABLED_REASON = 'CONTROL_FLOW_NOT_IN_LOOP';
337343
/**
338344
* This mixin adds a check to make sure the 'controls_flow_statements' block
339345
* is contained in a loop. Otherwise a warning is added to the block.
@@ -365,19 +371,30 @@ const CONTROL_FLOW_IN_LOOP_CHECK_MIXIN = {
365371
// Don't change state if:
366372
// * It's at the start of a drag.
367373
// * It's not a move event.
368-
if (!ws.isDragging || ws.isDragging() || e.type !== Events.BLOCK_MOVE) {
374+
if (
375+
!ws.isDragging ||
376+
ws.isDragging() ||
377+
(e.type !== Events.BLOCK_MOVE && e.type !== Events.BLOCK_CREATE)
378+
) {
369379
return;
370380
}
371381
const enabled = !!this.getSurroundLoop();
372382
this.setWarningText(
373383
enabled ? null : Msg['CONTROLS_FLOW_STATEMENTS_WARNING'],
374384
);
385+
375386
if (!this.isInFlyout) {
376-
const group = Events.getGroup();
377-
// Makes it so the move and the disable event get undone together.
378-
Events.setGroup(e.group);
379-
this.setEnabled(enabled);
380-
Events.setGroup(group);
387+
try {
388+
// There is no need to record the enable/disable change on the undo/redo
389+
// list since the change will be automatically recreated when replayed.
390+
eventUtils.setRecordUndo(false);
391+
this.setDisabledReason(
392+
!enabled,
393+
CONTROL_FLOW_NOT_IN_LOOP_DISABLED_REASON,
394+
);
395+
} finally {
396+
eventUtils.setRecordUndo(true);
397+
}
381398
}
382399
},
383400
};

0 commit comments

Comments
 (0)