Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proceds blockly parte 2 #2

Merged
merged 25 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# dependencies
/node_modules
/node_modules
/dist
54 changes: 12 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,21 @@
# blockly-my-plugin [![Built on Blockly](https://tinyurl.com/built-on-blockly)](https://github.com/google/blockly)
¡Hola! :vulcan_salute: Este es un proyecto relacionado a [Pilas Bloques](https://pilasbloques.program.ar) :heart:. En el repositorio de ese proyecto encontrarás las guías sobre [cómo contribuir](https://github.com/Program-AR/pilas-bloques-app/blob/develop/CONTRIBUTING.md) y el [código de conducta](https://github.com/Program-AR/pilas-bloques-app/blob/develop/CODE_OF_CONDUCT.md), que son guías que aplican también a este proyecto.

<!--
- TODO: Edit plugin description.
-->
Hi! :vulcan_salute: This is a project related to [Pilas Bloques](https://pilasbloques.program.ar) :heart:. In that project's repository you'll find the [contribution guidelines](https://github.com/Program-AR/pilas-bloques-app/blob/develop/CONTRIBUTING_en.md) and the [code of conduct](https://github.com/Program-AR/pilas-bloques-app/blob/develop/CODE_OF_CONDUCT_en.md) which also apply to this project.

A [Blockly](https://www.npmjs.com/package/blockly) plugin that ...
# Blockly Proceds

## Installation

### Yarn

```
yarn add blockly-my-plugin
```

### npm

```
npm install blockly-my-plugin --save
```
This Blockly plugin installs new custom procedures for blockly, with custom modifications:
- The parameters now can be easily added and removed with buttons, replacing the mutator popup.
- The arguments (`variables_get`) are associated with the procedure. All this blocks now have a `$parent` field with the id of the procedure where they belong. **For this to work, you must save this `$parent` in the mutation of `variables_get`**.
- The 'help' option was removed from the context menu.
- Procedure descriptions are disabled by default.

## Usage

<!--
- TODO: Update usage.
-->

```js
import * as Blockly from 'blockly';
import {Plugin} from 'blockly-my-plugin';

// Inject Blockly.
const workspace = Blockly.inject('blocklyDiv', {
toolbox: toolboxCategories,
});
If you desire to use a different language than Spanish, you can define your own translations for the needed blocks using `Blockly.Msg`, for example:

// Initialize plugin.
const plugin = new Plugin(workspace);
plugin.init();
```javascript
Blockly.Msg.PROCEDURES_DEFNORETURN_COMMENT = 'your translation';
```

## API

<!--
- TODO: describe the API.
-->

## License

Apache 2.0
Then proceed to call `procedsBlocklyInit()` to load these new translations. Otherwise, you can use the default language by calling `setDefacultLocale()`:
Loading