Skip to content

Commit 3982e75

Browse files
authored
chore: format (#111)
1 parent bc471c4 commit 3982e75

File tree

3 files changed

+21
-22
lines changed

3 files changed

+21
-22
lines changed

src/index.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,19 @@ export class KeyboardNavigation {
4343
navigationController.setHasFocus(false);
4444
});
4545
}
46-
46+
4747
/**
4848
* Update the theme to match the selected glow colour to the cursor
4949
* colour.
5050
*/
5151
setGlowTheme() {
52-
const newTheme = Blockly.Theme.defineTheme('zelosDerived',
53-
{
54-
name: 'zelosDerived',
55-
base: Blockly.Themes.Zelos,
56-
componentStyles: {
57-
selectedGlowColour: '#ffa200',
58-
}
59-
}
60-
);
52+
const newTheme = Blockly.Theme.defineTheme('zelosDerived', {
53+
name: 'zelosDerived',
54+
base: Blockly.Themes.Zelos,
55+
componentStyles: {
56+
selectedGlowColour: '#ffa200',
57+
},
58+
});
6159
this.workspace.setTheme(newTheme);
6260
}
6361
}

src/line_cursor.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* @author [email protected] (Abby Schmiedt)
1414
*/
1515

16-
import { FieldColour } from '@blockly/field-colour';
16+
import {FieldColour} from '@blockly/field-colour';
1717
import * as Blockly from 'blockly/core';
1818
import {ASTNode, Marker} from 'blockly/core';
1919

@@ -415,7 +415,7 @@ export class LineCursor extends Marker {
415415
* Set the location of the marker and call the update method.
416416
* Setting isStack to true will only work if the newLocation is the top most
417417
* output or previous connection on a stack.
418-
*
418+
*
419419
* Overrides drawing logic to call `setSelected` if the location is
420420
* a block, for testing on October 28 2024.
421421
*
@@ -430,18 +430,18 @@ export class LineCursor extends Marker {
430430
return;
431431
}
432432

433-
const newNodeIsFieldColour = newNode?.getType() == ASTNode.types.FIELD &&
434-
(newNode.getLocation() as Blockly.Field) instanceof FieldColour;
435-
const oldNodeIsFieldColour = oldNode?.getType() == ASTNode.types.FIELD &&
436-
(oldNode.getLocation() as Blockly.Field) instanceof FieldColour
437-
433+
const newNodeIsFieldColour =
434+
newNode?.getType() == ASTNode.types.FIELD &&
435+
(newNode.getLocation() as Blockly.Field) instanceof FieldColour;
436+
const oldNodeIsFieldColour =
437+
oldNode?.getType() == ASTNode.types.FIELD &&
438+
(oldNode.getLocation() as Blockly.Field) instanceof FieldColour;
438439

439440
if (newNode?.getType() == ASTNode.types.BLOCK) {
440441
drawer.hide();
441442
const block = newNode.getLocation() as Blockly.BlockSvg;
442443
Blockly.common.setSelected(block);
443-
}
444-
else if (newNodeIsFieldColour) {
444+
} else if (newNodeIsFieldColour) {
445445
drawer.hide();
446446

447447
if (oldNode?.getType() == ASTNode.types.BLOCK) {
@@ -455,8 +455,7 @@ export class LineCursor extends Marker {
455455
const field = newNode.getLocation() as FieldColour;
456456
const block = field.getSourceBlock() as Blockly.BlockSvg;
457457
block.addSelect();
458-
}
459-
else {
458+
} else {
460459
if (oldNode?.getType() == ASTNode.types.BLOCK) {
461460
Blockly.common.setSelected(null);
462461
} else if (oldNodeIsFieldColour) {

test/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ import {runCode, registerRunCodeShortcut} from './runCode';
2727
function loadScenario(workspace: Blockly.WorkspaceSvg) {
2828
const scenarioSelector = location.search.match(/scenario=([^&]+)/);
2929
// Default to the sunny day example.
30-
const scenarioString = scenarioSelector ? scenarioSelector[1] : 'simpleCircle';
30+
const scenarioString = scenarioSelector
31+
? scenarioSelector[1]
32+
: 'simpleCircle';
3133
const selector = document.getElementById(
3234
'scenarioSelect',
3335
) as HTMLSelectElement;

0 commit comments

Comments
 (0)