From bc896233ad0af1b07a441656866f7d68a74cdbf5 Mon Sep 17 00:00:00 2001 From: Bowen Tan Date: Wed, 1 Dec 2021 17:20:00 +0800 Subject: [PATCH] fix module examples --- examples/dialog/dialogInList.json | 20 ++++++++--------- examples/list/listModule.json | 22 +++++++++---------- examples/module/index.json | 14 ++++++------ .../runtime/src/utils/parseModuleSchema.ts | 2 +- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/examples/dialog/dialogInList.json b/examples/dialog/dialogInList.json index b6f99e32..53ff4e25 100644 --- a/examples/dialog/dialogInList.json +++ b/examples/dialog/dialogInList.json @@ -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" } } diff --git a/examples/list/listModule.json b/examples/list/listModule.json index 41d26268..ca0c28f5 100644 --- a/examples/list/listModule.json +++ b/examples/list/listModule.json @@ -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" } } diff --git a/examples/module/index.json b/examples/module/index.json index 76fec4c8..5db3d054 100644 --- a/examples/module/index.json +++ b/examples/module/index.json @@ -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" } } diff --git a/packages/runtime/src/utils/parseModuleSchema.ts b/packages/runtime/src/utils/parseModuleSchema.ts index 3d385f24..6ee9de54 100644 --- a/packages/runtime/src/utils/parseModuleSchema.ts +++ b/packages/runtime/src/utils/parseModuleSchema.ts @@ -37,6 +37,6 @@ export function parseModuleSchema( } traverse(module.components); - + traverse(module.spec.stateMap); return module; }