Skip to content

Commit f2905fd

Browse files
committed
starting to put sample blocks in
1 parent 841cc4e commit f2905fd

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
export const category =
2+
{
3+
kind: 'category',
4+
name: 'Components',
5+
contents: [
6+
{
7+
kind: 'category',
8+
name: 'Touch Sensor',
9+
contents: [
10+
{
11+
kind: "block",
12+
type: "mrc_call_python_function",
13+
extraState: {"functionKind": "instance",
14+
"MODULE_OR_CLASS": "touch",
15+
"returnType": "bool",
16+
"args": [],
17+
"tooltip": "Returns if the touch sensor is pressed or not",
18+
},
19+
fields: {
20+
FUNC: 'is_pressed',
21+
},
22+
}
23+
]
24+
},
25+
{
26+
kind: 'category',
27+
name: 'Smart Motor',
28+
contents: [ ]
29+
},
30+
{
31+
kind: 'category',
32+
name: 'Servo',
33+
contents: [ ]
34+
},
35+
{
36+
kind: 'category',
37+
name: 'Color Range Sensor',
38+
contents: [ ]
39+
}
40+
],
41+
}

src/toolbox/toolbox.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {category as textCategory} from './text_category';
2828
import {category as listsCategory} from './lists_category';
2929
import {category as miscCategory} from './misc_category';
3030
import {category as methodsCategory} from './methods_category';
31+
import {category as componentSampleCategory} from './component_samples_category';
3132

3233
export function getToolboxJSON(
3334
opt_includeExportedBlocksFromProject: toolboxItems.ContentsType[],
@@ -72,6 +73,7 @@ export function getToolboxJSON(
7273
custom: 'VARIABLE',
7374
},
7475
methodsCategory,
76+
componentSampleCategory,
7577
]);
7678

7779
return {

0 commit comments

Comments
 (0)