scratchblocks-plus 1.0.2 → 1.1.0
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 +24 -9
- package/build/scratchblocks-plus.min.es.js +2 -2
- package/build/scratchblocks-plus.min.es.js.map +1 -1
- package/build/scratchblocks-plus.min.js +2 -2
- package/build/scratchblocks-plus.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/node-ssr.js +81 -0
- package/package.json +25 -4
- package/scratch3/blocks.js +31 -3
- package/scratch3/style.css.js +6 -2
- package/build/scratchblocks.min.es.js +0 -9254
- package/build/scratchblocks.min.es.js.map +0 -1
- package/build/scratchblocks.min.js +0 -8925
- package/build/scratchblocks.min.js.map +0 -1
- package/build/translations-all-es.js.map +0 -1
- package/build/translations-all.js.map +0 -1
- package/build/translations-es.js.map +0 -1
- package/build/translations.js.map +0 -1
package/README.md
CHANGED
|
@@ -7,13 +7,28 @@ Make pictures of Scratch blocks from text.
|
|
|
7
7
|
|
|
8
8
|
**[Try it out!](https://luyifei2011.github.io/scratchblocks-plus/)**
|
|
9
9
|
|
|
10
|
+
[Documentation](https://luyifei2011.github.io/scratchblocks-plus-docs/)
|
|
11
|
+
|
|
10
12
|
---
|
|
11
13
|
|
|
12
14
|
**scratchblocks-plus** is a fork of **scratchblocks**, and adds the following features:
|
|
13
15
|
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
+
- matrix support
|
|
17
|
+
- [try it out!](https://luyifei2011.github.io/scratchblocks-plus/#?style=scratch3&script=display%20(%7B01010%2C%0A%20%20%20%20%20%20%20%20%20%2010101%2C%0A%20%20%20%20%20%20%20%20%20%2010001%2C%0A%20%20%20%20%20%20%20%20%20%2001010%2C%0A%20%20%20%20%20%20%20%20%20%2000100%7D%20v))
|
|
18
|
+
- issue: [scratchblocks#509](https://github.com/scratchblocks/scratchblocks/issues/509)
|
|
19
|
+
- PR: [scratchblocks#573](https://github.com/scratchblocks/scratchblocks/pull/573)
|
|
16
20
|
- block highlight
|
|
21
|
+
- [example 1](https://luyifei2011.github.io/scratchblocks-plus/example/text-highlight.html)
|
|
22
|
+
- [example 2](https://luyifei2011.github.io/scratchblocks-plus/example/speech-highlight.html)
|
|
23
|
+
- dropdown menu translate
|
|
24
|
+
- [try it out!](https://luyifei2011.github.io/scratchblocks-plus/translator/#?lang=zh_cn&script=go%20to%20(mouse-pointer%20v))
|
|
25
|
+
- issue: [scratchblocks#324](https://github.com/scratchblocks/scratchblocks/issues/324)
|
|
26
|
+
- PR: [scratchblocks#556](https://github.com/scratchblocks/scratchblocks/pull/556)
|
|
27
|
+
- server-side rendering
|
|
28
|
+
- issue: [scratchblocks#402](https://github.com/scratchblocks/scratchblocks/issues/402)
|
|
29
|
+
- PR: [scratchblocks#589](https://github.com/scratchblocks/scratchblocks/pull/589)
|
|
30
|
+
- basic TypeScript support
|
|
31
|
+
- and more!
|
|
17
32
|
|
|
18
33
|
**scratchblocks-plus** is compatible with **scratchblocks**, so you can use it as a drop-in replacement.
|
|
19
34
|
|
|
@@ -46,7 +61,7 @@ It uses the [pandoc_scratchblocks](https://github.com/CodeClub/pandoc_scratchblo
|
|
|
46
61
|
This would probably be a good way to write a Scratch book.
|
|
47
62
|
-->
|
|
48
63
|
|
|
49
|
-
|
|
64
|
+
## React
|
|
50
65
|
|
|
51
66
|
Use the [scratchblocks-plus-react](https://github.com/LuYifei2011/scratchblocks-plus-react) package to render scratchblocks in React.
|
|
52
67
|
|
|
@@ -125,7 +140,7 @@ The translations files are hundreds of kilobytes in size, so to keep your page b
|
|
|
125
140
|
For example, a translations file that just loads the German language (ISO code `de`) would look something like this:
|
|
126
141
|
|
|
127
142
|
```js
|
|
128
|
-
|
|
143
|
+
scratchblocks.loadLanguages({
|
|
129
144
|
de: <contents of locales/de.json>
|
|
130
145
|
})
|
|
131
146
|
```
|
|
@@ -134,7 +149,7 @@ If you're using a JavaScript bundler you should be able to build your own transl
|
|
|
134
149
|
This requires your bundler to allow importing JSON files as JavaScript.
|
|
135
150
|
|
|
136
151
|
```js
|
|
137
|
-
|
|
152
|
+
scratchblocks.loadLanguages({
|
|
138
153
|
de: require('scratchblocks/locales/de.json'),
|
|
139
154
|
})
|
|
140
155
|
```
|
|
@@ -154,7 +169,7 @@ scratchblocks.renderMatching('pre.blocks');
|
|
|
154
169
|
|
|
155
170
|
## ESM Support
|
|
156
171
|
|
|
157
|
-
|
|
172
|
+
scratchblocks-plus can be properly loaded as an ESM module. The ESM version, instead of defining `window.scratchblocks`, default-exports the `scratchblocks` object. Similarly, the JavaScript translation files default-exports a function to load the translations.
|
|
158
173
|
|
|
159
174
|
```js
|
|
160
175
|
import scratchblocks from "./scratchblocks-plus-es-min.js";
|
|
@@ -189,19 +204,19 @@ npm start
|
|
|
189
204
|
|
|
190
205
|
Then open <http://localhost:8000/> :-)
|
|
191
206
|
|
|
192
|
-
For more details, see [`CONTRIBUTING.md`](https://github.com/LuYifei2011/scratchblocks-plus/blob/
|
|
207
|
+
For more details, see [`CONTRIBUTING.md`](https://github.com/LuYifei2011/scratchblocks-plus/blob/main/.github/CONTRIBUTING.md).
|
|
193
208
|
|
|
194
209
|
# Credits
|
|
195
210
|
|
|
196
211
|
Many, many thanks to the [contributors](https://github.com/LuYifei2011/scratchblocks-plus/graphs/contributors)!
|
|
197
212
|
|
|
198
|
-
-
|
|
213
|
+
- Maintained by [LuYifei2011](https://github.com/LuYifei2011)
|
|
199
214
|
- This is a fork of [scratchblocks](https://github.com/scratchblocks/scratchblocks), so all the credit there still applies here.
|
|
200
215
|
- Original scratchblocks library by [tjvr](https://github.com/tjvr)
|
|
201
216
|
- Original scratchblocks library maintained by tjvr and [apple502j](https://github.com/apple502j)
|
|
202
217
|
- Icons derived from [Scratch Blocks](https://github.com/scratchfoundation/scratch-blocks) (Apache License 2.0)
|
|
203
218
|
- Scratch 2 SVG proof-of-concept, shapes & filters by [as-com](https://github.com/as-com)
|
|
204
|
-
- Anna helped with a formula, and pointed out that
|
|
219
|
+
- Anna helped with a formula, and pointed out that tjvr can't read graphs
|
|
205
220
|
- JSO designed the syntax and wrote the original [Block Plugin](https://en.scratch-wiki.info/wiki/Block_Plugin_\(1.4\))
|
|
206
221
|
- Help with translation code from [joooni](https://scratch.mit.edu/users/joooni/)
|
|
207
222
|
- Block translations from the [scratch-l10n repository](https://github.com/scratchfoundation/scratch-l10n/)
|