Skip to content

Commit 9971b64

Browse files
committed
fix: address minor feedback from automated review
1 parent 44643d6 commit 9971b64

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

src/index.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ export {
8686
export * from "./xml";
8787

8888
interface ScratchBlocksOptions extends Blockly.BlocklyOptions {
89-
theme?: ScratchBlocksTheme;
89+
/**
90+
* Scratch uses "theme" to talk about the shape of blocks. The Blockly concept of a theme affects CSS properties and
91+
* aligns more closely with "color mode" in Scratch.
92+
*/
93+
scratchTheme?: ScratchBlocksTheme;
9094
}
9195

9296
function sanitizeTheme(theme?: ScratchBlocksTheme) {
@@ -112,10 +116,10 @@ export function inject(container: Element, options: ScratchBlocksOptions) {
112116
registerStatusIndicatorLabelFlyoutInflater();
113117
registerScratchContinuousCategory();
114118

115-
const theme = sanitizeTheme(options.theme);
119+
const scratchTheme = sanitizeTheme(options.scratchTheme);
116120

117121
Object.assign(options, {
118-
renderer: `scratch_${theme}`,
122+
renderer: `scratch_${scratchTheme}`,
119123
plugins: {
120124
toolbox: ScratchContinuousToolbox,
121125
flyoutsVerticalToolbox: CheckableContinuousFlyout,

src/renderer/cat/renderer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ export class CatScratchRenderer extends ScratchRenderer {
1818
return new ConstantProvider();
1919
}
2020

21-
makeDrawer_(block: CatBlockSvg, info: RenderInfo) {
22-
return new Drawer(block, info);
21+
makeDrawer_(block: Blockly.BlockSvg, info: RenderInfo) {
22+
return new Drawer(block as CatBlockSvg, info);
2323
}
2424
}
2525

src/renderer/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,5 @@ export class ConstantProvider extends Blockly.zelos.ConstantProvider {
6969
width - 40
7070
} 0 a20,20 0 0,1 20,20`;
7171
return bowlerHatPath;
72-
};
72+
}
7373
}

0 commit comments

Comments
 (0)