fix module examples

This commit is contained in:
Bowen Tan 2021-12-01 17:20:00 +08:00
parent 5bfea34423
commit bc896233ad
4 changed files with 29 additions and 29 deletions

View File

@ -20,7 +20,7 @@
},
"components": [
{
"id": "{{$moduleId}}hstack",
"id": "hstack",
"type": "chakra_ui/v1/hstack",
"properties": {
"spacing": "24px"
@ -28,7 +28,7 @@
"traits": []
},
{
"id": "{{$moduleId}}name",
"id": "name",
"type": "core/v1/text",
"properties": {
"value": {
@ -41,7 +41,7 @@
"type": "core/v1/slot",
"properties": {
"container": {
"id": "{{$moduleId}}hstack",
"id": "hstack",
"slot": "content"
}
}
@ -49,7 +49,7 @@
]
},
{
"id": "{{$moduleId}}email",
"id": "email",
"type": "core/v1/text",
"properties": {
"value": {
@ -62,7 +62,7 @@
"type": "core/v1/slot",
"properties": {
"container": {
"id": "{{$moduleId}}hstack",
"id": "hstack",
"slot": "content"
}
}
@ -70,7 +70,7 @@
]
},
{
"id": "{{$moduleId}}deleteButton",
"id": "deleteButton",
"type": "chakra_ui/v1/button",
"properties": {
"text": {
@ -106,7 +106,7 @@
"type": "core/v1/slot",
"properties": {
"container": {
"id": "{{$moduleId}}hstack",
"id": "hstack",
"slot": "content"
}
}
@ -114,7 +114,7 @@
]
},
{
"id": "{{$moduleId}}editButton",
"id": "editButton",
"type": "chakra_ui/v1/button",
"properties": {
"text": {
@ -137,7 +137,7 @@
"method": {
"name": "onClickEdit",
"parameters": {
"moduleId": "{{$moduleId}}"
"moduleId": ""
}
},
"wait": {},
@ -150,7 +150,7 @@
"type": "core/v1/slot",
"properties": {
"container": {
"id": "{{$moduleId}}hstack",
"id": "hstack",
"slot": "content"
}
}

View File

@ -13,18 +13,18 @@
"properties": {},
"events": ["onEdit"],
"stateMap": {
"value": "{{$moduleId}}input.value"
"value": "input.value"
}
},
"components": [
{
"id": "{{$moduleId}}hstack",
"id": "hstack",
"type": "chakra_ui/v1/hstack",
"properties": {},
"traits": []
},
{
"id": "{{$moduleId}}text",
"id": "text",
"type": "core/v1/text",
"properties": {
"value": {
@ -37,7 +37,7 @@
"type": "core/v1/slot",
"properties": {
"container": {
"id": "{{$moduleId}}hstack",
"id": "hstack",
"slot": "content"
}
}
@ -45,11 +45,11 @@
]
},
{
"id": "{{$moduleId}}inputValueText",
"id": "inputValueText",
"type": "core/v1/text",
"properties": {
"value": {
"raw": "**{{ {{$moduleId}}input.value }}**",
"raw": "**{{ input.value }}**",
"format": "md"
}
},
@ -58,7 +58,7 @@
"type": "core/v1/slot",
"properties": {
"container": {
"id": "{{$moduleId}}hstack",
"id": "hstack",
"slot": "content"
}
}
@ -66,7 +66,7 @@
]
},
{
"id": "{{$moduleId}}input",
"id": "input",
"type": "chakra_ui/v1/input",
"properties": {},
"traits": [
@ -74,7 +74,7 @@
"type": "core/v1/slot",
"properties": {
"container": {
"id": "{{$moduleId}}hstack",
"id": "hstack",
"slot": "content"
}
}
@ -82,7 +82,7 @@
]
},
{
"id": "{{$moduleId}}button",
"id": "button",
"type": "chakra_ui/v1/button",
"properties": {
"text": {
@ -114,7 +114,7 @@
"type": "core/v1/slot",
"properties": {
"container": {
"id": "{{$moduleId}}hstack",
"id": "hstack",
"slot": "content"
}
}

View File

@ -18,18 +18,18 @@
},
"events": ["onSubmit"],
"stateMap": {
"value": "{{$moduleId}}__input.value"
"value": "input.value"
}
},
"components": [
{
"id": "{{$moduleId}}__hstack",
"id": "hstack",
"type": "chakra_ui/v1/hstack",
"properties": {},
"traits": []
},
{
"id": "{{$moduleId}}__input",
"id": "input",
"type": "chakra_ui/v1/input",
"properties": {},
"traits": [
@ -37,7 +37,7 @@
"type": "core/v1/slot",
"properties": {
"container": {
"id": "{{$moduleId}}__hstack",
"id": "hstack",
"slot": "content"
}
}
@ -45,11 +45,11 @@
]
},
{
"id": "{{$moduleId}}__button",
"id": "button",
"type": "chakra_ui/v1/button",
"properties": {
"text": {
"raw": "{{littleFormModule__input.value}}",
"raw": "{{input.value}}",
"format": "md"
}
},
@ -77,7 +77,7 @@
"type": "core/v1/slot",
"properties": {
"container": {
"id": "{{$moduleId}}__hstack",
"id": "hstack",
"slot": "content"
}
}

View File

@ -37,6 +37,6 @@ export function parseModuleSchema(
}
traverse(module.components);
traverse(module.spec.stateMap);
return module;
}