set up block defaults
This commit is contained in:
parent
47cbcd23c2
commit
4d20186879
3 changed files with 10 additions and 6 deletions
|
|
@ -12,7 +12,6 @@ export default {
|
|||
},
|
||||
|
||||
visualization: {
|
||||
inputsInline: false,
|
||||
colour: 230
|
||||
},
|
||||
|
||||
|
|
|
|||
3
src/blocks/defaults.js
Normal file
3
src/blocks/defaults.js
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
export default {
|
||||
inputsInline: false
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
import { map } from 'lodash-es'
|
||||
import Blockly from 'blockly'
|
||||
|
||||
import blockDefaults from './defaults.js'
|
||||
import ALL_BLOCKS from './all.js'
|
||||
import { toBlockJSON } from '../tools/tools.js'
|
||||
import { getBlockType } from '../tools/util.js'
|
||||
|
|
@ -20,11 +21,12 @@ const processCommonBlock = commonBlock => {
|
|||
}
|
||||
|
||||
const processCustomBlock = customBlock => {
|
||||
customBlocksJson.push(
|
||||
customBlock.type
|
||||
? toBlockJSON(customBlock)
|
||||
: customBlock.json
|
||||
)
|
||||
customBlocksJson.push({
|
||||
...blockDefaults,
|
||||
...customBlock.type
|
||||
? toBlockJSON(customBlock)
|
||||
: customBlock.json
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue