@nitro-bolt/scratchblocks 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -22
- package/build/scratchblocks.min.es.js +2 -2
- package/build/scratchblocks.min.es.js.map +1 -1
- package/build/scratchblocks.min.js +2 -2
- package/build/scratchblocks.min.js.map +1 -1
- package/build/translations-all-es.js +1 -1
- package/build/translations-all.js +1 -1
- package/build/translations-es.js +1 -1
- package/build/translations.js +1 -1
- package/package.json +1 -1
- package/syntax/blocks.js +1 -0
- package/syntax/syntax.js +1 -38
package/README.md
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
This fork adds NitroBolt's scratch-blocks
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
[array value]
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
`@addInput` draw the left and right extendable-input controls independently.
|
|
1
|
+
This fork adds NitroBolt's scratch-blocks features:
|
|
2
|
+
|
|
3
|
+
- Object blocks use `{object value}` and object inputs use `{}`.
|
|
4
|
+
- Array blocks use `[array value]` and array inputs use `[]`.
|
|
5
|
+
- Overrides stay inside object and array block delimiters, such as
|
|
6
|
+
`[array value :: #4D5057]`.
|
|
7
|
+
- Use `[ ]` when an empty text input is needed instead of an array input.
|
|
8
|
+
- `\n` starts a new visual row inside the same block.
|
|
9
|
+
- `@delInput` and `@addInput` render the two extendable-input controls
|
|
10
|
+
independently.
|
|
11
|
+
- `c-block` makes a custom block C-shaped. Put the branch on the following
|
|
12
|
+
lines and close it with `end`:
|
|
13
|
+
|
|
14
|
+
```text
|
|
15
|
+
new function [] :: #FF894D c-block
|
|
16
|
+
say [Hello!]
|
|
17
|
+
end
|
|
18
|
+
```
|
|
20
19
|
|
|
21
20
|
<!--
|
|
22
21
|
Make pictures of Scratch blocks from text.
|
|
@@ -83,7 +82,7 @@ Make sure this appears at the end of the page (just before the closing `</body>`
|
|
|
83
82
|
```js
|
|
84
83
|
<script>
|
|
85
84
|
scratchblocks.renderMatching('pre.blocks', {
|
|
86
|
-
style: 'scratch3', // Optional; Scratch 3 is the only supported style.
|
|
85
|
+
style: 'scratch3', // Optional; Scratch 3 is the only supported style.
|
|
87
86
|
languages: ['en', 'de'], // Optional, defaults to ['en'].
|
|
88
87
|
scale: 1, // Optional, defaults to 1
|
|
89
88
|
});
|
|
@@ -91,8 +90,8 @@ scratchblocks.renderMatching('pre.blocks', {
|
|
|
91
90
|
```
|
|
92
91
|
The `renderMatching()` function takes a CSS-style selector for the elements that contain scratchblocks code: we use `pre.blocks` to target `pre` tags with the class `blocks`.
|
|
93
92
|
|
|
94
|
-
The `style` option controls how the blocks appear. `scratch3` and
|
|
95
|
-
`scratch3-high-contrast` are supported.
|
|
93
|
+
The `style` option controls how the blocks appear. `scratch3` and
|
|
94
|
+
`scratch3-high-contrast` are supported.
|
|
96
95
|
|
|
97
96
|
### Inline blocks
|
|
98
97
|
|