Skip to content

Commit 8cbc7ed

Browse files
release: v10.1.0
Merge pull request #7371 from google/rc/v10.1.0
2 parents e76b9c5 + 74049c7 commit 8cbc7ed

File tree

315 files changed

+6299
-5584
lines changed

Some content is hidden

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

315 files changed

+6299
-5584
lines changed

appengine/storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ def xmlToKey(xml_content):
4444
# Store XML and return a generated key.
4545
xml_hash = int(hashlib.sha1(xml_content.encode("utf-8")).hexdigest(), 16)
4646
xml_hash = int(xml_hash % (2 ** 64) - (2 ** 63))
47-
lookup_query = Xml.query(Xml.xml_hash == xml_hash)
4847
client = ndb.Client()
4948
with client.context():
49+
lookup_query = Xml.query(Xml.xml_hash == xml_hash)
5050
lookup_result = lookup_query.get()
5151
if lookup_result:
5252
xml_key = lookup_result.key.string_id()

blocks/blocks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ export const blocks: {[key: string]: BlockDefinition} = Object.assign(
4242
math.blocks,
4343
procedures.blocks,
4444
variables.blocks,
45-
variablesDynamic.blocks
45+
variablesDynamic.blocks,
4646
);

blocks/lists.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ const LISTS_CREATE_WITH = {
130130
this.updateShape_();
131131
this.setOutput(true, 'Array');
132132
this.setMutator(
133-
new MutatorIcon(['lists_create_with_item'], this as unknown as BlockSvg)
133+
new MutatorIcon(['lists_create_with_item'], this as unknown as BlockSvg),
134134
); // BUG(#6905)
135135
this.setTooltip(Msg['LISTS_CREATE_WITH_TOOLTIP']);
136136
},
@@ -182,16 +182,16 @@ const LISTS_CREATE_WITH = {
182182
*/
183183
decompose: function (
184184
this: CreateWithBlock,
185-
workspace: Workspace
185+
workspace: Workspace,
186186
): ContainerBlock {
187187
const containerBlock = workspace.newBlock(
188-
'lists_create_with_container'
188+
'lists_create_with_container',
189189
) as ContainerBlock;
190190
(containerBlock as BlockSvg).initSvg();
191191
let connection = containerBlock.getInput('STACK')!.connection;
192192
for (let i = 0; i < this.itemCount_; i++) {
193193
const itemBlock = workspace.newBlock(
194-
'lists_create_with_item'
194+
'lists_create_with_item',
195195
) as ItemBlock;
196196
(itemBlock as BlockSvg).initSvg();
197197
if (!itemBlock.previousConnection) {
@@ -209,7 +209,7 @@ const LISTS_CREATE_WITH = {
209209
*/
210210
compose: function (this: CreateWithBlock, containerBlock: Block) {
211211
let itemBlock: ItemBlock | null = containerBlock.getInputTargetBlock(
212-
'STACK'
212+
'STACK',
213213
) as ItemBlock;
214214
// Count number of inputs.
215215
const connections: Connection[] = [];
@@ -242,7 +242,7 @@ const LISTS_CREATE_WITH = {
242242
*/
243243
saveConnections: function (this: CreateWithBlock, containerBlock: Block) {
244244
let itemBlock: ItemBlock | null = containerBlock.getInputTargetBlock(
245-
'STACK'
245+
'STACK',
246246
) as ItemBlock;
247247
let i = 0;
248248
while (itemBlock) {
@@ -265,7 +265,7 @@ const LISTS_CREATE_WITH = {
265265
this.removeInput('EMPTY');
266266
} else if (!this.itemCount_ && !this.getInput('EMPTY')) {
267267
this.appendDummyInput('EMPTY').appendField(
268-
Msg['LISTS_CREATE_EMPTY_TITLE']
268+
Msg['LISTS_CREATE_EMPTY_TITLE'],
269269
);
270270
}
271271
// Add new inputs.
@@ -297,7 +297,7 @@ const LISTS_CREATE_WITH_CONTAINER = {
297297
init: function (this: ContainerBlock) {
298298
this.setStyle('list_blocks');
299299
this.appendDummyInput().appendField(
300-
Msg['LISTS_CREATE_WITH_CONTAINER_TITLE_ADD']
300+
Msg['LISTS_CREATE_WITH_CONTAINER_TITLE_ADD'],
301301
);
302302
this.appendStatementInput('STACK');
303303
this.setTooltip(Msg['LISTS_CREATE_WITH_CONTAINER_TOOLTIP']);
@@ -358,7 +358,7 @@ const LISTS_INDEXOF = {
358358
this.setTooltip(() => {
359359
return Msg['LISTS_INDEX_OF_TOOLTIP'].replace(
360360
'%1',
361-
this.workspace.options.oneBasedIndex ? '0' : '-1'
361+
this.workspace.options.oneBasedIndex ? '0' : '-1',
362362
);
363363
});
364364
},
@@ -401,7 +401,7 @@ const LISTS_GETINDEX = {
401401
const isStatement = value === 'REMOVE';
402402
(this.getSourceBlock() as GetIndexBlock).updateStatement_(isStatement);
403403
return undefined;
404-
}
404+
},
405405
);
406406
this.appendValueInput('VALUE')
407407
.setCheck('Array')
@@ -568,7 +568,7 @@ const LISTS_GETINDEX = {
568568
this.appendValueInput('AT').setCheck('Number');
569569
if (Msg['ORDINAL_NUMBER_SUFFIX']) {
570570
this.appendDummyInput('ORDINAL').appendField(
571-
Msg['ORDINAL_NUMBER_SUFFIX']
571+
Msg['ORDINAL_NUMBER_SUFFIX'],
572572
);
573573
}
574574
} else {
@@ -596,7 +596,7 @@ const LISTS_GETINDEX = {
596596
return null;
597597
}
598598
return undefined;
599-
}
599+
},
600600
);
601601
this.getInput('AT')!.appendField(menu, 'WHERE');
602602
if (Msg['LISTS_GET_INDEX_TAIL']) {
@@ -685,7 +685,7 @@ const LISTS_SETINDEX = {
685685
' ' +
686686
Msg['LISTS_INDEX_FROM_START_TOOLTIP'].replace(
687687
'%1',
688-
this.workspace.options.oneBasedIndex ? '#1' : '#0'
688+
this.workspace.options.oneBasedIndex ? '#1' : '#0',
689689
);
690690
}
691691
return tooltip;
@@ -747,7 +747,7 @@ const LISTS_SETINDEX = {
747747
this.appendValueInput('AT').setCheck('Number');
748748
if (Msg['ORDINAL_NUMBER_SUFFIX']) {
749749
this.appendDummyInput('ORDINAL').appendField(
750-
Msg['ORDINAL_NUMBER_SUFFIX']
750+
Msg['ORDINAL_NUMBER_SUFFIX'],
751751
);
752752
}
753753
} else {
@@ -775,7 +775,7 @@ const LISTS_SETINDEX = {
775775
return null;
776776
}
777777
return undefined;
778-
}
778+
},
779779
);
780780
this.moveInputBefore('AT', 'TO');
781781
if (this.getInput('ORDINAL')) {
@@ -887,7 +887,7 @@ const LISTS_GETSUBLIST = {
887887
this.appendValueInput('AT' + n).setCheck('Number');
888888
if (Msg['ORDINAL_NUMBER_SUFFIX']) {
889889
this.appendDummyInput('ORDINAL' + n).appendField(
890-
Msg['ORDINAL_NUMBER_SUFFIX']
890+
Msg['ORDINAL_NUMBER_SUFFIX'],
891891
);
892892
}
893893
} else {
@@ -915,7 +915,7 @@ const LISTS_GETSUBLIST = {
915915
block.setFieldValue(value, 'WHERE' + n);
916916
return null;
917917
}
918-
}
918+
},
919919
);
920920
this.getInput('AT' + n)!.appendField(menu, 'WHERE' + n);
921921
if (n === 1) {

blocks/logic.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ const TOOLTIPS_BY_OP = {
276276

277277
Extensions.register(
278278
'logic_op_tooltip',
279-
Extensions.buildTooltipForDropdown('OP', TOOLTIPS_BY_OP)
279+
Extensions.buildTooltipForDropdown('OP', TOOLTIPS_BY_OP),
280280
);
281281

282282
/** Type of a block that has CONTROLS_IF_MUTATOR_MIXIN */
@@ -417,10 +417,10 @@ const CONTROLS_IF_MUTATOR_MIXIN = {
417417
this.elseifCount_++;
418418
// TODO(#6920): null valid, undefined not.
419419
valueConnections.push(
420-
clauseBlock.valueConnection_ as Connection | null
420+
clauseBlock.valueConnection_ as Connection | null,
421421
);
422422
statementConnections.push(
423-
clauseBlock.statementConnection_ as Connection | null
423+
clauseBlock.statementConnection_ as Connection | null,
424424
);
425425
break;
426426
case 'controls_if_else':
@@ -438,7 +438,7 @@ const CONTROLS_IF_MUTATOR_MIXIN = {
438438
this.reconnectChildBlocks_(
439439
valueConnections,
440440
statementConnections,
441-
elseStatementConnection
441+
elseStatementConnection,
442442
);
443443
},
444444
/**
@@ -500,7 +500,7 @@ const CONTROLS_IF_MUTATOR_MIXIN = {
500500
this.reconnectChildBlocks_(
501501
valueConnections,
502502
statementConnections,
503-
elseStatementConnection
503+
elseStatementConnection,
504504
);
505505
},
506506
/**
@@ -523,12 +523,12 @@ const CONTROLS_IF_MUTATOR_MIXIN = {
523523
.setCheck('Boolean')
524524
.appendField(Msg['CONTROLS_IF_MSG_ELSEIF']);
525525
this.appendStatementInput('DO' + i).appendField(
526-
Msg['CONTROLS_IF_MSG_THEN']
526+
Msg['CONTROLS_IF_MSG_THEN'],
527527
);
528528
}
529529
if (this.elseCount_) {
530530
this.appendStatementInput('ELSE').appendField(
531-
Msg['CONTROLS_IF_MSG_ELSE']
531+
Msg['CONTROLS_IF_MSG_ELSE'],
532532
);
533533
}
534534
},
@@ -545,7 +545,7 @@ const CONTROLS_IF_MUTATOR_MIXIN = {
545545
this: IfBlock,
546546
valueConnections: Array<Connection | null>,
547547
statementConnections: Array<Connection | null>,
548-
elseStatementConnection: Connection | null
548+
elseStatementConnection: Connection | null,
549549
) {
550550
for (let i = 1; i <= this.elseifCount_; i++) {
551551
valueConnections[i]?.reconnect(this, 'IF' + i);
@@ -559,7 +559,7 @@ Extensions.registerMutator(
559559
'controls_if_mutator',
560560
CONTROLS_IF_MUTATOR_MIXIN,
561561
null as unknown as undefined, // TODO(#6920)
562-
['controls_if_elseif', 'controls_if_else']
562+
['controls_if_elseif', 'controls_if_else'],
563563
);
564564

565565
/**
@@ -579,7 +579,7 @@ const CONTROLS_IF_TOOLTIP_EXTENSION = function (this: IfBlock) {
579579
return Msg['CONTROLS_IF_TOOLTIP_4'];
580580
}
581581
return '';
582-
}.bind(this)
582+
}.bind(this),
583583
);
584584
};
585585

@@ -617,7 +617,7 @@ const LOGIC_COMPARE_ONCHANGE_MIXIN = {
617617
blockB &&
618618
!this.workspace.connectionChecker.doTypeChecks(
619619
blockA.outputConnection!,
620-
blockB.outputConnection!
620+
blockB.outputConnection!,
621621
)
622622
) {
623623
// Mismatch between two inputs. Revert the block connections,
@@ -686,7 +686,7 @@ const LOGIC_TERNARY_ONCHANGE_MIXIN = {
686686
block &&
687687
!block.workspace.connectionChecker.doTypeChecks(
688688
block.outputConnection!,
689-
parentConnection
689+
parentConnection,
690690
)
691691
) {
692692
// Ensure that any disconnections are grouped with the causing

blocks/loops.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ const WHILE_UNTIL_TOOLTIPS = {
227227

228228
Extensions.register(
229229
'controls_whileUntil_tooltip',
230-
Extensions.buildTooltipForDropdown('MODE', WHILE_UNTIL_TOOLTIPS)
230+
Extensions.buildTooltipForDropdown('MODE', WHILE_UNTIL_TOOLTIPS),
231231
);
232232

233233
/**
@@ -242,7 +242,7 @@ const BREAK_CONTINUE_TOOLTIPS = {
242242

243243
Extensions.register(
244244
'controls_flow_tooltip',
245-
Extensions.buildTooltipForDropdown('FLOW', BREAK_CONTINUE_TOOLTIPS)
245+
Extensions.buildTooltipForDropdown('FLOW', BREAK_CONTINUE_TOOLTIPS),
246246
);
247247

248248
/** Type of a block that has CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN */
@@ -264,7 +264,7 @@ const CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN = {
264264
*/
265265
customContextMenu: function (
266266
this: CustomContextMenuBlock,
267-
options: Array<ContextMenuOption | LegacyContextMenuOption>
267+
options: Array<ContextMenuOption | LegacyContextMenuOption>,
268268
) {
269269
if (this.isInFlyout) {
270270
return;
@@ -289,17 +289,20 @@ const CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN = {
289289

290290
Extensions.registerMixin(
291291
'contextMenu_newGetVariableBlock',
292-
CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN
292+
CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN,
293293
);
294294

295295
Extensions.register(
296296
'controls_for_tooltip',
297-
Extensions.buildTooltipWithFieldText('%{BKY_CONTROLS_FOR_TOOLTIP}', 'VAR')
297+
Extensions.buildTooltipWithFieldText('%{BKY_CONTROLS_FOR_TOOLTIP}', 'VAR'),
298298
);
299299

300300
Extensions.register(
301301
'controls_forEach_tooltip',
302-
Extensions.buildTooltipWithFieldText('%{BKY_CONTROLS_FOREACH_TOOLTIP}', 'VAR')
302+
Extensions.buildTooltipWithFieldText(
303+
'%{BKY_CONTROLS_FOREACH_TOOLTIP}',
304+
'VAR',
305+
),
303306
);
304307

305308
/**
@@ -366,7 +369,7 @@ const CONTROL_FLOW_IN_LOOP_CHECK_MIXIN = {
366369
}
367370
const enabled = !!this.getSurroundLoop();
368371
this.setWarningText(
369-
enabled ? null : Msg['CONTROLS_FLOW_STATEMENTS_WARNING']
372+
enabled ? null : Msg['CONTROLS_FLOW_STATEMENTS_WARNING'],
370373
);
371374
if (!this.isInFlyout) {
372375
const group = Events.getGroup();
@@ -380,7 +383,7 @@ const CONTROL_FLOW_IN_LOOP_CHECK_MIXIN = {
380383

381384
Extensions.registerMixin(
382385
'controls_flow_in_loop_check',
383-
CONTROL_FLOW_IN_LOOP_CHECK_MIXIN
386+
CONTROL_FLOW_IN_LOOP_CHECK_MIXIN,
384387
);
385388

386389
// Register provided blocks.

blocks/math.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ const TOOLTIPS_BY_OP = {
427427

428428
Extensions.register(
429429
'math_op_tooltip',
430-
Extensions.buildTooltipForDropdown('OP', TOOLTIPS_BY_OP)
430+
Extensions.buildTooltipForDropdown('OP', TOOLTIPS_BY_OP),
431431
);
432432

433433
/** Type of a block that has IS_DIVISBLEBY_MUTATOR_MIXIN */
@@ -502,20 +502,20 @@ const IS_DIVISIBLE_MUTATOR_EXTENSION = function (this: DivisiblebyBlock) {
502502
const divisorInput = option === 'DIVISIBLE_BY';
503503
(this.getSourceBlock() as DivisiblebyBlock).updateShape_(divisorInput);
504504
return undefined; // FieldValidators can't be void. Use option as-is.
505-
}
505+
},
506506
);
507507
};
508508

509509
Extensions.registerMutator(
510510
'math_is_divisibleby_mutator',
511511
IS_DIVISIBLEBY_MUTATOR_MIXIN,
512-
IS_DIVISIBLE_MUTATOR_EXTENSION
512+
IS_DIVISIBLE_MUTATOR_EXTENSION,
513513
);
514514

515515
// Update the tooltip of 'math_change' block to reference the variable.
516516
Extensions.register(
517517
'math_change_tooltip',
518-
Extensions.buildTooltipWithFieldText('%{BKY_MATH_CHANGE_TOOLTIP}', 'VAR')
518+
Extensions.buildTooltipWithFieldText('%{BKY_MATH_CHANGE_TOOLTIP}', 'VAR'),
519519
);
520520

521521
/** Type of a block that has LIST_MODES_MUTATOR_MIXIN */
@@ -578,14 +578,14 @@ const LIST_MODES_MUTATOR_EXTENSION = function (this: ListModesBlock) {
578578
function (this: ListModesBlock, newOp: string) {
579579
this.updateType_(newOp);
580580
return undefined;
581-
}.bind(this)
581+
}.bind(this),
582582
);
583583
};
584584

585585
Extensions.registerMutator(
586586
'math_modes_of_list_mutator',
587587
LIST_MODES_MUTATOR_MIXIN,
588-
LIST_MODES_MUTATOR_EXTENSION
588+
LIST_MODES_MUTATOR_EXTENSION,
589589
);
590590

591591
// Register provided blocks.

0 commit comments

Comments
 (0)