初始化提交
This commit is contained in:
119
boards/default_src/micropython_nrf51822_microbit/index.js
Normal file
119
boards/default_src/micropython_nrf51822_microbit/index.js
Normal file
@@ -0,0 +1,119 @@
|
||||
import * as Blockly from 'blockly/core';
|
||||
import { Profile } from 'mixly';
|
||||
|
||||
import {
|
||||
PythonVariablesBlocks,
|
||||
PythonControlBlocks,
|
||||
PythonMathBlocks,
|
||||
PythonTextBlocks,
|
||||
PythonListsBlocks,
|
||||
PythonDictsBlocks,
|
||||
PythonLogicBlocks,
|
||||
PythonStorageBlocks,
|
||||
PythonProceduresBlocks,
|
||||
PythonTupleBlocks,
|
||||
PythonSetBlocks,
|
||||
PythonHtmlBlocks,
|
||||
PythonUtilityBlocks,
|
||||
PythonVariablesGenerators,
|
||||
PythonControlGenerators,
|
||||
PythonMathGenerators,
|
||||
PythonTextGenerators,
|
||||
PythonListsGenerators,
|
||||
PythonDictsGenerators,
|
||||
PythonLogicGenerators,
|
||||
PythonStorageGenerators,
|
||||
PythonProceduresGenerators,
|
||||
PythonTupleGenerators,
|
||||
PythonSetGenerators,
|
||||
PythonHtmlGenerators,
|
||||
PythonUtilityGenerators,
|
||||
Procedures,
|
||||
Variables,
|
||||
Python
|
||||
} from '@mixly/python';
|
||||
|
||||
import {
|
||||
MicropythonNRF51822MicrobitPins,
|
||||
MicropythonNRF51822MicrobitActuatorBlocks,
|
||||
MicropythonNRF51822MicrobitCommunicateBlocks,
|
||||
MicropythonNRF51822MicrobitDisplayBlocks,
|
||||
MicropythonNRF51822MicrobitFactoryBlocks,
|
||||
MicropythonNRF51822MicrobitInoutBlocks,
|
||||
MicropythonNRF51822MicrobitPinsBlocks,
|
||||
MicropythonNRF51822MicrobitSensorBlocks,
|
||||
MicropythonNRF51822MicrobitSerialBlocks,
|
||||
MicropythonNRF51822MicrobitSystemBlocks,
|
||||
MicropythonNRF51822MicrobitActuatorGenerators,
|
||||
MicropythonNRF51822MicrobitCommunicateGenerators,
|
||||
MicropythonNRF51822MicrobitDisplayGenerators,
|
||||
MicropythonNRF51822MicrobitFactoryGenerators,
|
||||
MicropythonNRF51822MicrobitInoutGenerators,
|
||||
MicropythonNRF51822MicrobitPinsGenerators,
|
||||
MicropythonNRF51822MicrobitSensorGenerators,
|
||||
MicropythonNRF51822MicrobitSerialGenerators,
|
||||
MicropythonNRF51822MicrobitSystemGenerators
|
||||
} from './';
|
||||
|
||||
import './css/color_microbit_python_advance.css';
|
||||
|
||||
Object.assign(Blockly.Variables, Variables);
|
||||
Object.assign(Blockly.Procedures, Procedures);
|
||||
Blockly.Python = Python;
|
||||
Blockly.generator = Python;
|
||||
|
||||
Profile.default = {};
|
||||
Object.assign(Profile, MicropythonNRF51822MicrobitPins);
|
||||
Object.assign(Profile.default, MicropythonNRF51822MicrobitPins['microbit']);
|
||||
|
||||
Object.assign(
|
||||
Blockly.Blocks,
|
||||
PythonVariablesBlocks,
|
||||
PythonControlBlocks,
|
||||
PythonMathBlocks,
|
||||
PythonTextBlocks,
|
||||
PythonListsBlocks,
|
||||
PythonDictsBlocks,
|
||||
PythonLogicBlocks,
|
||||
PythonStorageBlocks,
|
||||
PythonProceduresBlocks,
|
||||
PythonTupleBlocks,
|
||||
PythonSetBlocks,
|
||||
PythonHtmlBlocks,
|
||||
PythonUtilityBlocks,
|
||||
MicropythonNRF51822MicrobitActuatorBlocks,
|
||||
MicropythonNRF51822MicrobitCommunicateBlocks,
|
||||
MicropythonNRF51822MicrobitDisplayBlocks,
|
||||
MicropythonNRF51822MicrobitFactoryBlocks,
|
||||
MicropythonNRF51822MicrobitInoutBlocks,
|
||||
MicropythonNRF51822MicrobitPinsBlocks,
|
||||
MicropythonNRF51822MicrobitSensorBlocks,
|
||||
MicropythonNRF51822MicrobitSerialBlocks,
|
||||
MicropythonNRF51822MicrobitSystemBlocks
|
||||
);
|
||||
|
||||
Object.assign(
|
||||
Blockly.Python.forBlock,
|
||||
PythonVariablesGenerators,
|
||||
PythonControlGenerators,
|
||||
PythonMathGenerators,
|
||||
PythonTextGenerators,
|
||||
PythonListsGenerators,
|
||||
PythonDictsGenerators,
|
||||
PythonLogicGenerators,
|
||||
PythonStorageGenerators,
|
||||
PythonProceduresGenerators,
|
||||
PythonTupleGenerators,
|
||||
PythonSetGenerators,
|
||||
PythonHtmlGenerators,
|
||||
PythonUtilityGenerators,
|
||||
MicropythonNRF51822MicrobitActuatorGenerators,
|
||||
MicropythonNRF51822MicrobitCommunicateGenerators,
|
||||
MicropythonNRF51822MicrobitDisplayGenerators,
|
||||
MicropythonNRF51822MicrobitFactoryGenerators,
|
||||
MicropythonNRF51822MicrobitInoutGenerators,
|
||||
MicropythonNRF51822MicrobitPinsGenerators,
|
||||
MicropythonNRF51822MicrobitSensorGenerators,
|
||||
MicropythonNRF51822MicrobitSerialGenerators,
|
||||
MicropythonNRF51822MicrobitSystemGenerators
|
||||
);
|
||||
Reference in New Issue
Block a user