From 6885b385a1710a4ebe6f372f2b7e1a8ab9c04aba Mon Sep 17 00:00:00 2001 From: Ivan Starkov Date: Thu, 5 Dec 2024 23:48:27 +0700 Subject: [PATCH] feat: Add initial text to the Content Block (#4498) ## Description ref #3994 ## Steps for reproduction 1. click button 2. expect xyz ## Code Review - [ ] hi @kof, I need you to do - conceptual review (architecture, feature-correctness) - detailed review (read every line) - test it on preview ## Before requesting a review - [ ] made a self-review - [ ] added inline comments where things may be not obvious (the "why", not "what") ## Before merging - [ ] tested locally and on preview environment (preview dev login: 0000) - [ ] updated [test cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md) document - [ ] added tests - [ ] if any new env variables are added, added them to `.env` file --------- Co-authored-by: Oleg Isonen --- packages/react-sdk/src/core-components.ts | 124 +++++++++++++++++++++- 1 file changed, 123 insertions(+), 1 deletion(-) diff --git a/packages/react-sdk/src/core-components.ts b/packages/react-sdk/src/core-components.ts index 54615fad8f57..108b389b7dd5 100644 --- a/packages/react-sdk/src/core-components.ts +++ b/packages/react-sdk/src/core-components.ts @@ -164,7 +164,129 @@ const blockMeta: WsComponentMeta = { type: "instance", label: "Templates", component: blockTemplateComponent, - children: [], + children: [ + { + type: "instance", + component: "Paragraph", + children: [ + { + type: "text", + value: "Paragraph text you can edit", + placeholder: true, + }, + ], + }, + { + type: "instance", + component: "List", + children: [ + { + type: "instance", + component: "ListItem", + children: [ + { + type: "text", + value: "List Item text you can edit", + placeholder: true, + }, + ], + }, + { + type: "instance", + component: "ListItem", + children: [ + { + type: "text", + value: "List Item text you can edit", + placeholder: true, + }, + ], + }, + { + type: "instance", + component: "ListItem", + children: [ + { + type: "text", + value: "List Item text you can edit", + placeholder: true, + }, + ], + }, + ], + }, + ], + }, + { + type: "instance", + component: "Paragraph", + children: [ + { + type: "text", + value: + "The Content Block component designates regions on the page where pre-styled instances can be inserted in ", + }, + { + type: "instance", + component: "RichTextLink", + children: [ + { + type: "text", + value: "Content mode", + }, + ], + props: [ + { + type: "string", + name: "href", + value: "https://wstd.us/content-block", + }, + ], + }, + { + type: "text", + value: ".", + }, + ], + }, + { + type: "instance", + component: "List", + children: [ + { + type: "instance", + component: "ListItem", + children: [ + { + type: "text", + value: + "In Content mode, you can edit any direct child instances that were pre-added to the Content Block, as well as add new instances predefined in Templates.", + }, + ], + }, + { + type: "instance", + component: "ListItem", + children: [ + { + type: "text", + value: + "To predefine instances for insertion in Content mode, switch to Design mode and add them to the Templates container.", + }, + ], + }, + { + type: "instance", + component: "ListItem", + children: [ + { + type: "text", + value: + "To insert predefined instances in Content mode, click the + button while hovering over the Content Block on the canvas and choose an instance from the list.", + }, + ], + }, + ], }, ], },