Skip to content

Commit c70ce6d

Browse files
DenisaCGhbcarlos
authored andcommitted
fixed build errors
1 parent 37a2da4 commit c70ce6d

File tree

5 files changed

+27
-19
lines changed

5 files changed

+27
-19
lines changed

src/factory.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import { BlocklyManager } from './manager';
1313
* A widget factory to create new instances of BlocklyEditor.
1414
*/
1515
export class BlocklyEditorFactory extends ABCWidgetFactory<
16-
BlocklyEditor,
17-
DocumentModel >
18-
{
16+
BlocklyEditor,
17+
DocumentModel
18+
> {
1919
private _manager: BlocklyManager;
2020
private _rendermime: IRenderMimeRegistry;
2121
private _language: string;
@@ -49,7 +49,11 @@ DocumentModel >
4949
): BlocklyEditor {
5050
return new BlocklyEditor({
5151
context,
52-
content: new BlocklyPanel(context, this._manager, this._rendermime, this._language)
52+
content: new BlocklyPanel(
53+
context,
54+
this._manager,
55+
this._rendermime,
56+
this._language)
5357
});
5458
}
5559
}

src/index.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,20 @@ namespace CommandIDs {
3131
/**
3232
* The id of the translation plugin.
3333
*/
34-
const PLUGIN_ID = '@jupyterlab/translation-extension:plugin';
34+
const PLUGIN_ID = '@jupyterlab/translation-extension:plugin';
3535

3636
/**
3737
* Initialization data for the jupyterlab-blocky extension.
3838
*/
3939
const plugin: JupyterFrontEndPlugin<IBlocklyManager> = {
4040
id: 'jupyterlab-blocky:plugin',
4141
autoStart: true,
42-
requires: [ILayoutRestorer, IRenderMimeRegistry, IFileBrowserFactory, ISettingRegistry, ITranslator],
42+
requires: [
43+
ILayoutRestorer,
44+
IRenderMimeRegistry,
45+
IFileBrowserFactory,
46+
ISettingRegistry,
47+
ITranslator],
4348
optional: [ILauncher, ICommandPalette],
4449
provides: IBlocklyManager,
4550
activate: (
@@ -59,7 +64,7 @@ const plugin: JupyterFrontEndPlugin<IBlocklyManager> = {
5964

6065
// Creating the tracker for the document
6166
const tracker = new WidgetTracker<BlocklyEditor>({ namespace });
62-
67+
6368
// Handle state restoration.
6469
if (restorer) {
6570
// When restoring the app, if the document was open, reopen it
@@ -112,24 +117,25 @@ const plugin: JupyterFrontEndPlugin<IBlocklyManager> = {
112117

113118
function getSetting(setting: ISettingRegistry.ISettings): string {
114119
// Read the settings and convert to the correct type
115-
let currentLocale: string = setting.get('locale').composite as string;
120+
const currentLocale: string = setting.get('locale').composite as string;
116121
return currentLocale;
117122
}
118123

119124
// Wait for the application to be restored and
120125
// for the settings for this plugin to be loaded
121-
settings
122-
.load(PLUGIN_ID)
126+
settings.load(PLUGIN_ID)
123127
.then(setting => {
124128
// Read the settings
125-
let currentLocale = getSetting(setting);
129+
const currentLocale = getSetting(setting);
126130

127131
// Listen for our plugin setting changes using Signal
128-
setting.changed.connect(getSetting);
132+
setting.changed.connect(getSetting);
129133

130134
// Get new language and call the function that modifies the language name accordingly.
131135
// Also, make the transformation to have the name of the language package as in Blockly.
132-
let language = currentLocale[currentLocale.length - 2].toUpperCase() + currentLocale[currentLocale.length - 1].toLowerCase();
136+
const language =
137+
currentLocale[currentLocale.length - 2].toUpperCase() +
138+
currentLocale[currentLocale.length - 1].toLowerCase();
133139
console.log(`Current Language : '${language}'`);
134140

135141
// Transmitting the current language to the manager.

src/layout.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class BlocklyLayout extends PanelLayout {
3232
constructor(
3333
manager: BlocklyManager,
3434
sessionContext: ISessionContext,
35-
rendermime: IRenderMimeRegistry,
35+
rendermime: IRenderMimeRegistry
3636
// translator: ITranslator
3737
) {
3838
super();
@@ -153,7 +153,7 @@ export class BlocklyLayout extends PanelLayout {
153153
// categories = trans.__('Category');
154154
}
155155

156-
private _resizeWorkspace(): void {
156+
private _resizeWorkspace(): void {
157157
//Resize logic.
158158
const rect = this.parent.node.getBoundingClientRect();
159159
const { height } = this._outputArea.node.getBoundingClientRect();

src/manager.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ export class BlocklyManager implements IBlocklyManager {
2626
this._activeGenerator = BlocklyPy;
2727
this._generators = new Map<string, Blockly.Generator>();
2828
this._language = 'En'; // By default we choose English.
29-
3029
this._changed = new Signal<BlocklyManager, void>(this);
3130
}
3231

@@ -87,7 +86,7 @@ namespace Private {
8786
case 'Fr':
8887
module = import('blockly/msg/fr');
8988
break;
90-
case ('Sa' || 'Ar'):
89+
case 'Sa' || 'Ar':
9190
module = import('blockly/msg/ar');
9291
break;
9392
case 'Cz':
@@ -180,4 +179,3 @@ namespace Private {
180179
});
181180
}
182181
}
183-

src/widget.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export class BlocklyPanel extends Panel {
6565
context: DocumentRegistry.IContext<DocumentModel>,
6666
manager: BlocklyManager,
6767
rendermime: IRenderMimeRegistry,
68-
language: String,
68+
language: string
6969
// translator: ITranslator
7070
) {
7171
super({

0 commit comments

Comments
 (0)